[R] function SAS dataset to R matrix (dataframe)

Douglas Bates bates at stat.wisc.edu
Wed Jul 5 15:38:11 CEST 2000


Didier Leibovici <didier at fmrib.ox.ac.uk> writes:

> Is there such a function (like sas.get for S ...)
> to be able to convert a SAS dataset (PC one .sd2)
> to a dataframe or matrix in R?

There is a package called "foreign" in the src/contrib/Devel section
of CRAN that can read data sets in the SAS XPORT format.  I don't know
of functions to read the SAS .sd2 format.

If you do convert the data set to the XPORT format and read it with
functions in the foreign package, be careful to check the last row.
Determining exactly what is the last row in a SAS data set is not
easy and those functions may get it wrong.  That is why the package is
in the Devel section.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list