write.dta {foreign} | R Documentation |
Writes the data frame to file in the Stata version 6.0 or 7.0 binary format. Does not write matrix variables.
write.dta(dataframe, filename,version=7)
dataframe |
a data frame |
filename |
character string giving filename |
version |
Stata version: 6 and 7 are supported |
The columns in the data frame become variables in the Stata data set. Missing values are correctly handled. Nothing is done with factor levels, which should end up as variable labels. The major difference between versions is that 7.0 allows 32-character variable names.
NULL
Thomas Lumley
Stata 6.0 Users Manual, Stata 7.0 Programming manual describe the file formats
data(swiss) write.dta(swiss,swissfile<-tempfile()) read.dta(swissfile)