[R] Export R dataframe to STA with Variable Labels

reesemike mreese at jhu.edu
Wed Mar 24 17:50:22 CET 2010


I've successfully imported a Stata file (dta) into R with the read.dta
(function) (i.e., data, variable labels, and value labels import correctly). 
After working in R, I use write.dta to export the data frame back to a *.dta
file.  The data and value labels convert fine, but the variable labels do
not - the variable labels are written as the variable name(e.g., the
variable label for f1sn1 is listed as "f1sn1" instead of "students academic
grade").

write.dta(d,"immigration.dta",version=7L,convert.factor="labels")

Are there any suggestions for maintaining the variable labels between a
Stata-->R-->Stata import/export.

My apologies for imprecise language.  I'm new to R and am not familiar with
its vocabulary.  IF this goes well, I hope to convince my collegues to
migrate from Stata to R.

Mike  
-- 
View this message in context: http://n4.nabble.com/Export-R-dataframe-to-STA-with-Variable-Labels-tp1680841p1680841.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list