write_spss | R Documentation |
GADSdat
object to a fileWrite 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.
write_spss(GADSdat, filePath)
write_stata(GADSdat, filePath)
GADSdat |
A |
filePath |
Path of |
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 in SPSS
,
c) exporting date or time variables is currently not supported,
d) missing tags are slightly incompatible between SPSS
and eatGADS
as eatGADS
supports unlimited discrete missing tags (but no range of missing tags) and
SPSS
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 precisely export_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.
Writes file to disc, returns NULL
.
# write to spss
tmp <- tempfile(fileext = ".sav")
write_spss(pisa, tmp)
# write to stata
tmp <- tempfile(fileext = ".dta")
write_stata(pisa, tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.