From the course: R Programming in Data Science: High Variety Data
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Read form and write to DBF
From the course: R Programming in Data Science: High Variety Data
Read form and write to DBF
- [Instructor] DBF's are an extremely common way to exchange information, and here's how to import them using the foreign library in R. Now foreign, is most likely already installed, in your version of R, but use the library root command to make sure that it's active. Also, be sure that you've chosen "chapter 0 3" in the exercise files, as your current working directory. That's just to make sure that we can access the files that we're going to import. To import a DBF file, requires the "read.dbf" command, and here's how it looks. I'm going to create a vector. And we'll call it "foreignDBF", and into that vector, I'm going to place the results of "read.dbf". "Read.dbf" wants to know what file to import, and so I'm going to choose something from the "samples files folder". I'm going to choose the "eva.dbf" file, and when I import it, I want to make sure that strings are not imported as factors. To do that, I'm going to use "as is equals true", and when I run that, you'll see that I now…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.