Hello all, I have got some data in SAS, and I export it to one excel workbook with multiple sheets, for example, each sheet has the sales information for each state. Then I need to use R to do plotting, analysis on those sales data, where I need to load the data from excel to R. When I read the article at this link: http://yihui.name/en/2009/09/how-to-import-ms-excel-data-into-r/ I am wondering if there is an efficient way to read SAS data directly in R, or what would be a better connection between SAS and R if I need to use R to deal with data achieved from SAS? Thanks very much! Cheers, Rebecca ---------------------------------------------------------------------- This message, and any attachments, is for the intended r...{{dropped:5}}
On Jan 2, 2013, at 12:37 PM, Yuan, Rebecca wrote:> Hello all, > > I have got some data in SAS, and I export it to one excel workbook with multiple sheets, for example, each sheet has the sales information for each state. Then I need to use R to do plotting, analysis on those sales data, where I need to load the data from excel to R. > > When I read the article at this link: > > http://yihui.name/en/2009/09/how-to-import-ms-excel-data-into-r/ > > I am wondering if there is an efficient way to read SAS data directly in R, or what would be a better connection between SAS and R if I need to use R to deal with data achieved from SAS? >(Didn't type this with the intent of shouting but decided not to revise after fixing my sticky shift key.) THERE IS AN ENTIRE MANUAL ON EXPORT AND IMPORT STRATEGIES: On my machine the link to it "R Data Import/Export" appears if one uses the drop-down RHelp option from the Help menu: It links to http://127.0.0.1:29713/doc/manual/R-data.html But the details of where you should find it will depend on your GUI and OS setup. At any rate please find and read this fine manual. Your other question is also addressed in that manual. -- David.> Thanks very much! > > Cheers, > > Rebecca > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended r...{{dropped:5}} > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.David Winsemius Alameda, CA, USA
> On Jan 2, 2013, at 12:37 PM, Yuan, Rebecca wrote: >> I am wondering if there is an efficient way to read SAS data directly in R, or what would be a better connection between SAS and R if I need to use R to deal with data achieved from SAS? >>You may try foreign and SASxport packages: http://cran.r-project.org/web/packages/foreign/index.html http://cran.r-project.org/web/packages/SASxport/index.html But I heard that there might be some issues with the newest SAS version but give it a try...
Hello all, Thanks for the suggestions. I tried to import data from sas to R using foreign package. In the first step, I tried to use read.ssd() to convert the sas file sales.sas7bdat to SAS Transport formats. But I got an error message as ---------------------------------------------------------------> source("testss.r")Error in file.symlink(oldPath, linkPath) : symbolic links are not supported on this version of Windows --------------------------------------------------------------- While in testss.r, --------------------------------------------------------------- require(foreign) rm(list=ls()) sashome <- "C:/Program Files/SAS/SASFoundation/9.2/" checkfile <- read.ssd("C:/Documents and Settings/test","sales",sascmd = file.path(sashome, "sas.exe")) --------------------------------------------------------------- I am using windows xp and R 2.15.2. Thanks! Rebecca -----Original Message----- From: mehmet.suzen at gmail.com [mailto:mehmet.suzen at gmail.com] On Behalf Of Suzen, Mehmet Sent: Wednesday, January 02, 2013 4:14 PM To: David Winsemius Cc: Yuan, Rebecca; R help; sas-l at listserv.uga.edu Subject: Re: [R] suggestions about import SAS results to R.> On Jan 2, 2013, at 12:37 PM, Yuan, Rebecca wrote: >> I am wondering if there is an efficient way to read SAS data directly in R, or what would be a better connection between SAS and R if I need to use R to deal with data achieved from SAS? >>You may try foreign and SASxport packages: http://cran.r-project.org/web/packages/foreign/index.html http://cran.r-project.org/web/packages/SASxport/index.html But I heard that there might be some issues with the newest SAS version but give it a try... ---------------------------------------------------------------------- This message, and any attachments, is for the intended r...{{dropped:2}}