Learn R Programming

eatGADS (version 1.0.0)

write_spss: 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)

Value

Writes file to disc, returns NULL.

Arguments

GADSdat

A GADSdat object.

filePath

Path of sav file to write.

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 in SPSS. Furthermore, write_spss currently does not support exporting date or time variables.

Currently known limitations for write_stata are: (a) Variable format is dropped, (b) missing codes are dropped.

Examples

Run this code

# write to spss
tmp <- tempfile(fileext = ".sav")
write_spss(pisa, tmp)

# write to stata
tmp <- tempfile(fileext = ".dta")
write_stata(pisa, tmp)

Run the code above in your browser using DataLab