read.dta(file, convert.dates = TRUE, tz = "GMT",
convert.factors = TRUE, missing.type = FALSE)POSIXct class? Optionally, Stata dates (%d formats) are converted to R's
POSIXct class and variables with Stata value labels are
converted to factors. In any case the value label and format
information is stored as attributes on the returned data frame.
Stata 8.0 has 27 different missing data values. If missing.type
is TRUE a separate list is created with the same variable
names as the loaded data. For string variables the list value is
NULL. For other variables the value is NA where the
observation is not missing and 0-26 when the observation is
missing. This is attached as the code{"missing"} attribute of the
returned value.
write.dta,
attributes
DateTimeClasses
factordata(swiss)
write.dta(swiss,swissfile<-tempfile())
read.dta(swissfile)Run the code above in your browser using DataLab