How can I convert a SAS dataset into something readable by R?
January 23, 2009 5:48 PM   Subscribe

How to import a SAS dataset into R (with, unfortunately, one extra degree of difficulty...)?

I have a sas7bdat file. I'd like to import it into R (OS X). Unfortunately, I don't have access to SAS -- I'm away from work, and the file's sender has gone home for the weekend. Any free means of converting the file into a format readable by R? Thanks!
posted by docgonzo to Computers & Internet (5 answers total) 1 user marked this as a favorite
 
Found a similar question on a forum. The SAS page it links do doesn't say anything about converting formats like in the forum post, but at the very least you'll be able to look at your data.
posted by tgmayfield at 6:22 PM on January 23, 2009


Best answer: I don't use R but I run SAS and if you want, I may be able to save it as an Excel or text file for you. Just memail me.
posted by drpynchon at 7:39 PM on January 23, 2009


I checked in the R Data Import/Export Guide, and on the RSeek search engine. As far as I can tell the methods for getting sas7bdat files into R involve calling SAS, making SAS converting the data to the XPORT format, and importing that (using read.xport() in the foreign library).

Your best bet is probably to ask drpynchon to save it as XPORT, or alternatively tab-delimited data.
posted by grouse at 8:50 PM on January 23, 2009


Check your memail.. Problem solved.
posted by drpynchon at 9:47 PM on January 23, 2009


Response by poster: Problem solved! The very kind drpynchon converted it into a wealth of R-readable files. Thanks again!

For future reference, I didn't find anything in my searching that would do this for free -- it would be easiest to save it appropriately in SAS.
posted by docgonzo at 9:25 PM on January 25, 2009


« Older Condom Troubles   |   Help finding a Wordpress theme Newer »
This thread is closed to new comments.