[R] Read SAS data into R

Frank E Harrell Jr f.harrell at vanderbilt.edu
Fri May 11 20:43:27 CEST 2007

kseefeld wrote:
> Kim’s EZ Recipe for….
> SAS TO R, perfectly formatted table with no loss of data
> •	In SAS: Export SAS DB as access db
> •	In R go to directory where access db is stored
> •	Use package RODBC
> #R code
> #Create connection object (Can set up DSN but I’m too lazy to)
> c<-odbcConnectAccess("x.mdb")
> #Create table object, store db in object
> x<-sqlFetch(c, "test")
> #Close connection object
> odbcClose(c)

That doesn't help people who don't have SAS.

Note that an upcoming release of the Hmisc package has a new Access 
import function for users who have access to the mdbtools package on 
their operating system (e.g., linux).

Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

More information about the R-help mailing list