An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130326/74aac91e/attachment.pl>
suggestions about import SAS Transport files to R.
6 messages · Santosh, Ista Zahn, Duncan Murdoch +3 more
Hi Santosh,
On Tue, Mar 26, 2013 at 1:57 PM, Santosh <santosh2005 at gmail.com> wrote:
Dear Rxperts! My colleagues used SAS PROC COPY to generate the xpt files that could be read by the available "xpt" file reading packages in R. However, I am unable to use the R packages for reading SAS transport files generated through SAS PROC CPORT. I have tried SASxport, Hmisc, and foreign. Any ideas/suggestions are more than welcome!
Show us what you did and what errors R gave you. As of now we have no idea what your actual problem is. Best, Ista
Thanks so much!
Santosh
[[alternative HTML version deleted]]
______________________________________________ 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.
On 26/03/2013 1:57 PM, Santosh wrote:
Dear Rxperts! My colleagues used SAS PROC COPY to generate the xpt files that could be read by the available "xpt" file reading packages in R. However, I am unable to use the R packages for reading SAS transport files generated through SAS PROC CPORT. I have tried SASxport, Hmisc, and foreign.
I thought I had heard that SAS was now distributing some way to connect to R. So shouldn't you be asking them this question? Duncan Murdoch
Any ideas/suggestions are more than welcome! Thanks so much! Santosh [[alternative HTML version deleted]]
______________________________________________ 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.
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- project.org] On Behalf Of Duncan Murdoch Sent: Tuesday, March 26, 2013 11:32 AM To: Santosh Cc: r-help at r-project.org Subject: Re: [R] suggestions about import SAS Transport files to R. On 26/03/2013 1:57 PM, Santosh wrote:
Dear Rxperts! My colleagues used SAS PROC COPY to generate the xpt files that could
be
read by the available "xpt" file reading packages in R. However, I am unable to use the R packages for reading SAS transport files
generated
through SAS PROC CPORT. I have tried SASxport, Hmisc, and foreign.
I thought I had heard that SAS was now distributing some way to connect to R. So shouldn't you be asking them this question? Duncan Murdoch
Any ideas/suggestions are more than welcome! Thanks so much! Santosh [[alternative HTML version deleted]]
I may end up saying more than I know, and one of these days I may have the time to dig into the SAS to R pathway using SAS (but not yet). And as of now, SAS still does not make it easy to transfer data to R for use outside of the SAS environment. That said, SAS Proc Copy and Proc Cport create different portable file structures. I don't think the functions in the foreign package read Proc Copy transport files. My preferred way of transferring SAS data sets to R is to use Proc Export to convert the files to Stata format. The foreign package reads these just fine, and you don't have to worry about truncating variable names as can happen with Proc Cport. The drawback is that "SAS Access for PC Files Formats" needs to be licensed on the SAS side. Your colleagues can always use Proc Cport or use Proc Export and convert the files to CSV. Anyway you look at it, they need to recreate the files in a format that you can read. Dan Daniel J. Nordlund Washington State Department of Social and Health Services Planning, Performance, and Accountability Research and Data Analysis Division Olympia, WA 98504-5204
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130327/cf6f5c89/attachment.pl>
On Mar 26, 2013, at 12:38 PM, netra timalsina wrote:
Hei,I am writing a zoo object and then loading it shows the following error message.any suggestion would be appreciated? #create zoo seriesreg.zoo <- zooreg(1:100, seq(from=as.Date("1999-01-01 "),'along.with'=100, by= "1 day"))
#write zoo series
write.zoo(reg.zoo ,file= "test.Rdata")
Why are you writing an object that you have not yet created?
#load zoo objectnp <- load("test.Rdata")
And why are you mixing "write"-objects with "load"-operations"? "write" <--> "read" ::: "save" <--> "load" Furthermore if you "load" an image file, the object names that existed at the time of the 'save' are included in the file and get assigned at the time of the 'load'. 'save' and 'load' operate via side-effects, as do the base plot commands.
#error message"Error: bad restore file magic number (file may be corrupted) -- no data loaded In addition: Warning message: file 'temp_mette_1999_2009_zoo.Rdata' has magic number '"Inde' Use of save versions prior to 2 is deprecated" I am using R 2.15.1. thanx in advance Netra [[alternative HTML version deleted]]
David Winsemius Alameda, CA, USA