save.dta13 | R Documentation |
save.dta13
writes a Stata dta-file bytewise and saves the data
into a dta-file.
save.dta13( data, file, data.label = NULL, time.stamp = TRUE, convert.factors = TRUE, convert.dates = TRUE, tz = "GMT", add.rownames = FALSE, compress = FALSE, version = 117, convert.underscore = FALSE )
data |
data.frame. A data.frame Object. |
file |
character. Path to the dta file you want to export. |
data.label |
character. Name of the dta-file. |
time.stamp |
logical. If |
convert.factors |
logical. If |
convert.dates |
logical. If |
tz |
character. time zone specification to be used for POSIXct values and dates (if convert.dates is TRUE). ‘""’ is the current time zone, and ‘"GMT"’ is UTC (Universal Time, Coordinated). |
add.rownames |
logical. If |
compress |
logical. If |
version |
numeric. Stata format for the resulting dta-file either Stata version number (6 - 16) or the internal Stata dta-format (e.g. 117 for Stata 13). Experimental support for large datasets: Use version="15mp" to save the dataset in the new Stata 15/16 MP file format. This feature is not thoroughly tested yet. |
convert.underscore |
logical. If |
The function writes a dta-file to disk. The following features of the dta file format are supported:
Dataset label
Timestamp of file creation
Stata display formats. May be used with
sprintf
Stata data type (see Stata Corp 2014)
Variable labels
dta file format version
List of character vectors for the new strL string variable type. The first element is the identifier and the second element the string.
Jan Marvin Garbuszus jan.garbuszus@ruhr-uni-bochum.de
Sebastian Jeworutzki sebastian.jeworutzki@ruhr-uni-bochum.de
Stata Corp (2014): Description of .dta file format https://www.stata.com/help.cgi?dta
read.dta
in package foreign
and
memisc
for dta files from Stata versions < 13 and read_dta
in
package haven
for Stata version >= 13.
## Not run: library(readstata13) save.dta13(cars, file="cars.dta") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.