write_sav

0th

Percentile

Read SPSS (POR and SAV) files. Write SAV files.

Currently haven can read and write logical, integer, numeric, character and factors. See labelled for how labelled variables in Stata are handled in R. read_spss is an alias for read_sav.

Usage
write_sav(data, path)

read_por(path)

read_sav(path)

read_spss(path)

Arguments
data
Data frame to write.
path
Path to data. When reading data, if the path is a URL, the file will be first downloaded to a temporary location before reading.
Value

  • A data frame with additional "tbl_df" and "tbl" classes, which improve printing if dplyr is loaded.

    Variable labels are stored in the "label" attribute of each variable. It is not printed on the console, but the RStudio viewer will show it.

Aliases
  • read_por
  • read_sav
  • read_spss
  • write_sav
Examples
tmp <- tempfile(fileext = ".sav")
write_sav(mtcars, tmp)
read_sav(tmp)
Documentation reproduced from package haven, version 0.1.1, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.