Reads a Stata .dta file through TDA's rstata, which
supports releases 4, 6, 7 and 10 – the same set
tda_write_stata writes, so a file written here reads
back here.
Arguments
- file
path to the
.dtafile.- n_records
number of records to read.
NULL, the default, reads all of them.- missing
value to substitute for Stata's system missing. TDA's default is -5.
- upper_names
translate variable names to upper case (
rstata'sn=2). DefaultFALSE.- options
a named list of further TDA options, passed through. The reader also accepts, through
options, TDA'snoc=,msys=,arcd=,dfa=,fn=,p=,pn=,zoo=andvdf=switches.- dir
working directory.
- ...
passed to
tda_run.
Examples
d <- data.frame(id = 1:4, y = c(1.5, 2, 2.5, 3))
f <- tempfile(fileext = ".dta")
tda_write_stata(d, f)
tda_read_stata(f)
#> Id Y
#> 1 1 1.5
#> 2 2 2.0
#> 3 3 2.5
#> 4 4 3.0