read.dta {foreign} | R Documentation |
Reads a file in Stata v6.0 or v5.0 binary format into a dataframe.
read.dta(filename)
filename |
a filename as a character string |
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.
a data frame
Thomas Lumley
Stata Users Manual describes the format of the files
data(swiss) write.dta(swiss,swissfile<-tempfile()) read.dta(swissfile)