write_spss {eatGADS} | R Documentation |
Write a GADSdat
object to a file
Description
Write a GADSdat
object, which contains meta information as value and variable labels to an SPSS
file (sav
)
or Stata
file (dta
).
See 'details' for some important limitations.
Usage
write_spss(GADSdat, filePath)
write_stata(GADSdat, filePath)
Arguments
GADSdat |
A |
filePath |
Path of |
Details
The provided functionality relies on havens
write_sav
and
write_dta
functions.
Currently known limitations for write_spss
are:
a) value labels for long character variables (>
A10
) are dropped,b) under specific conditions very long character variables (>
A254
) are incorrectly displayed as multiple character variables inSPSS
,c) exporting date or time variables is currently not supported,
d) missing tags are slightly incompatible between
SPSS
andeatGADS
aseatGADS
supports unlimited discrete missing tags (but no range of missing tags) andSPSS
only supports up to three discrete missing tags or ranges of missing tags. For this purpose, if a variable is assigned more than three discrete missing tags,write_spss()
(more preciselyexport_tibble
) performs a silent conversion of the discrete missing tags into a missing range. If this conversion affects other value labels or values in the data not tagged as missing, an error is issued.
Currently known limitations for write_stata
are:
a) Variable format is dropped,
b) missing codes are dropped.
Value
Writes file to disc, returns NULL
.
Examples
# write to spss
tmp <- tempfile(fileext = ".sav")
write_spss(pisa, tmp)
# write to stata
tmp <- tempfile(fileext = ".dta")
write_stata(pisa, tmp)