Example
/* SAS */
libname rdata "C:/tmp";
data rdata.test;
input x y;
datalines;
5 6
7 8
;
run;
# R
setwd("C:/tmp")
# install.packages("haven")
library(haven)
test <- read_sas("test.sas7bdat")
The read_sas
function in the haven
package should be much faster than the sas7bdat
package's functions. As per Hadley's GitHub description:
Can read SAS's proprietary binary format (SAS7BDAT). The one other
package on CRAN that does that, sas7bdat, was created to document the
reverse-engineering effort. Thus its implementation is designed for
experimentation, rather than efficiency. Haven is significantly faster
and should also support a wider range of SAS files (including
compressed), and works with SAS7BCAT files.