> -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of zhiji19 > Sent: Sunday, December 05, 2010 9:26 PM > To: r-help@r-project.org > Subject: [R] How to this SAS transport file in R? > > > Dear All, > > I try to read the SAS transport file in R, but it shows error. Please > help! > I am using R 2.11.1 > > library(foreign) > download.file("http://isites.harvard.edu/fs/docs/icb.topic35387.files/d > emo_c.xpt","C:/Desktop/demo_c.xpt") > sasxport <- read.xport("C:/Desktop/demo_c.xpt") > > Error in lookup.xport(file) : file not in SAS transfer format > >
I think You need to use mode='wb' in your download statement download.file("http://isites.harvard.edu/fs/docs/icb.topic35387.files/demo_c.xpt", "C:/Desktop/demo_c.xpt", mode='wb') Hope this is helpful, 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 ______________________________________________ R-help@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.