write.dta {stataread}R Documentation

Write files in Stata binary format

Description

Writes the data frame to file in the Stata v6.0 binary format. Does not write matrix variables.

Usage

write.dta(dataframe, filename)

Arguments

dataframe a data frame
filename character string giving filename

Details

The variables in the Stata data set become the columns of the data frame. Missing values are correctly handled. The data label, variable labels, and timestamp are stored as attributes of the data frame. Nothing is done with factor levels, which should end up as variable labelss.

Value

NULL

Author(s)

Thomas Lumley

References

Stata v6.0 Users Manual describes the file format

See Also

read.dta,attributes

Examples

data(swiss)
write.dta(swiss,swissfile<-tempfile())
read.dta(swissfile)


[Package Contents]