[R] Problem exporting data using write.foreign

Andrew Miles rstuff.miles at gmail.com
Wed Oct 20 19:10:19 CEST 2010


My question is about the write.foreign() command in the foreign  
package.  I use a command like the following to try and output data  
and a code file to read my data into SAS.

write.foreign(data.frame.object, datafile="filepath",  
codefile="filepath", package="SAS", dataname="myData")

With my data set, it gives the following error:

Error in make.SAS.names(names(df), validvarname = validvarname) :
   Cannot uniquely abbreviate the variable names to 32 or fewer  
characters

I tried to write reproducible code but could not.  I'm not sure where  
to go from here.  What are the naming protocols for variables so that  
they can be exported using write.foreign()?

Thanks!

Andrew Miles



More information about the R-help mailing list