Part II Re: [R] read.ssd {foreign} (Reading a permanent SAS d ataset into an R data frame)
Stephen Arthur
sarthur67 at yahoo.com
Mon Dec 23 19:44:02 CET 2002
I'd like to thank the R Core Team for making the
parameters clearer for me on how to solve this
problem.
I think for now I will try to do most data management
tasks in SAS (from Oracle) and then use PROC EXPORT in
SAS to create a csv file that R can read and then I
can do my graphics, for publications and presentations
in R, because I frequently have variable names that
are greater than length 8.
I think this is the best solution for me given my
skills and the level of support I could expect to
receive for problems that are probably not high
priority. I have written R functions in the past. I
will have to re-learn how to do that. This will all
take time.
Using Partha's solution:
* 1) Partha's code in SAS for using PROC EXPORT is:
LIBNAME libref 'C:\Windows\Path';
* 'yourfile' could be permanent or temporary SAS data;
PROC EXPORT DATA=libref.yourfile
OUTFILE="C:\Windows\Path\yourfile.csv" REPLACE;
RUN;
* 2) Partha's code in R for importing a csv file is;
yourfile <-
read.csv("C:\\Windows\\Path\\yourfile.csv")
names(yourfile)
yourfile
I thought the task of reading SAS data into R and
separately reading Oracle data into R was going to be
much easier than I now know it is. I set up an Oracle
to SAS connection and an MS Access to SAS connection
on my system, just reading through notes on the web.
But because I realize R is much more a product of UNIX
than windows regarding database connectivity, I will
have to re-think my strategy.
Stephen
More information about the R-help
mailing list