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 from and write to SAS

Read from and write to SAS

From the course: R Programming in Data Science: High Variety Data

Start my 1-month free trial

Read from and write to SAS

- [Instructor] SAS is a powerful statistics tool and the foreign library in R provides ways to work with that data set. However, if you're going to read a native SAS file you're going to have to have access to SAS itself. You can write SAS files out without SAS available. With that in mind, let's look at how the foreign library works. Foreign is usually installed in the Base R package but to activate it you'll need to be sure to use the library command. We'll need some data to export and import so I'm going to create a data frame called Smalldf and you can see that over in the Global Environment. What's in it isn't important, it's just example data. To read a native SAS file you'll use read.ssd then you'll specify the directory of the file that you're going to import, it's actually a package. And again, this requires a copy of SAS because what's going to happen is read.ssd is actually going to create a program that will then have to be run inside of SAS. If you don't have access to…

Contents