read.dta {stataread}R Documentation

Read Stata binary files

Description

Reads a file in Stata v6.0 or v5.0 binary format into a dataframe.

Usage

read.dta(filename)

Arguments

filename a filename as a character string

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 variable characteristics, print formats, or value labels.

Value

a data frame

Author(s)

Thomas Lumley

References

Stata Users Manual describes the format of the files

See Also

write.dta,attributes

Examples

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

[Package Contents]