Hi All, I am trying to import a .sas7bdat file into R. I tried using Hmisc package's sasxport.get() function. temp <- sasxport.get("path\abcd.sas7bdat") I get an error that says "Error in lookup.xport(file) : file not in SAS transfer format" I am not familiar with SAS transfer format. Could somebody please clarify what is it that I am missing, Thanks for your time, Sashi
I can't say for sure as I have never used sasxport.get, but I believe that a SAS export file is not the same as a sas library. I believe you are trying to read a SAS library file with an R program that may have been written to read a SAS export file. John John Sorkin Chief Biostatistics and Informatics Univ. of Maryland School of Medicine Division of Gerontology and Geriatric Medicine JSorkin at grecc.umaryland.edu -----Original Message----- From: Sashi Challa <challa at ohsu.edu> To: r-help at r-project.org <r-help at r-project.org> Sent: 12/27/2010 7:43:05 PM Subject: [R] Reading sas7bdat files into R Hi All, I am trying to import a .sas7bdat file into R. I tried using Hmisc package's sasxport.get() function. temp <- sasxport.get("path\abcd.sas7bdat") I get an error that says "Error in lookup.xport(file) : file not in SAS transfer format" I am not familiar with SAS transfer format. Could somebody please clarify what is it that I am missing, Thanks for your time, Sashi ______________________________________________ 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. Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}}
Try sas.get to read the library. You will need the Hmisc package. Let me know if you have success. John John Sorkin Chief Biostatistics and Informatics Univ. of Maryland School of Medicine Division of Gerontology and Geriatric Medicine JSorkin at grecc.umaryland.edu -----Original Message----- From: Sashi Challa <challa at ohsu.edu> To: John Sorkin <jsorkin at grecc.umaryland.edu> To: r-help at r-project.org <r-help at r-project.org> Sent: 12/27/2010 7:58:22 PM Subject: RE: [R] Reading sas7bdat files into R Thanks for your reply John. I guess you are correct, sasxport.get function is for files in SAS transfer format. Do you know how I can convert the .sas7bdat file into SAS export file that I suppose will be in SAS transfer format? Thanks Sashi -----Original Message----- From: John Sorkin [mailto:jsorkin at grecc.umaryland.edu] Sent: Monday, December 27, 2010 4:52 PM To: Sashi Challa; r-help at r-project.org Subject: Re: [R] Reading sas7bdat files into R I can't say for sure as I have never used sasxport.get, but I believe that a SAS export file is not the same as a sas library. I believe you are trying to read a SAS library file with an R program that may have been written to read a SAS export file. John John Sorkin Chief Biostatistics and Informatics Univ. of Maryland School of Medicine Division of Gerontology and Geriatric Medicine JSorkin at grecc.umaryland.edu -----Original Message----- From: Sashi Challa <challa at ohsu.edu> To: r-help at r-project.org <r-help at r-project.org> Sent: 12/27/2010 7:43:05 PM Subject: [R] Reading sas7bdat files into R Hi All, I am trying to import a .sas7bdat file into R. I tried using Hmisc package's sasxport.get() function. temp <- sasxport.get("path\abcd.sas7bdat") I get an error that says "Error in lookup.xport(file) : file not in SAS transfer format" I am not familiar with SAS transfer format. Could somebody please clarify what is it that I am missing, Thanks for your time, Sashi ______________________________________________ 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. Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:13}}
Whoops - thought I was replying to google medstats instead of r-help. Frank ----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Reading-sas7bdat-files-into-R-tp3165608p3166047.html Sent from the R help mailing list archive at Nabble.com.
Sashi, There is also a command line utility for sas7bdat files called dsread (http://www.oview.co.uk/dsread/). I've never used it, but it looks good. Built for Windows, but should run under Linux with Wine. Jeremy Jeremy T. Hetzel Boston University -- View this message in context: http://r.789695.n4.nabble.com/Reading-sas7bdat-files-into-R-tp3165608p3168670.html Sent from the R help mailing list archive at Nabble.com.