Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

read_spss

Read an SPSS Data File


Description

read_spss reads data from a file stored in SPSS *.sav format. It returns data.frame and never converts string variables to factors. Also it prepares SPSS values/variables labels for working with val_lab/var_lab functions. User-missings values are ignored. read_spss is simple wrapper around read.spss function from package foreign.

Usage

read_spss(file, reencode = TRUE)

read_spss_to_list(file, reencode = TRUE)

Arguments

file

Character string: the name of the file or URL to read.

reencode

logical: should character strings be re-encoded to the current locale. The default is TRUE. NA means to do so in a UTF-8 locale, only. Alternatively, a character string specifying an encoding to assume for the file.

Value

read_spss returns data.frame.

read_spss_to_list returns list of variables from SPSS files.

See Also

read.spss in package foreign, val_lab, var_lab

Examples

## Not run: 

w = read_spss("project_123.sav") # to data.frame
list_w = read_spss_to_list("project_123.sav") # to list


## End(Not run)

expss

Tables, Labels and Some Useful Functions from Spreadsheets and 'SPSS' Statistics

v0.10.7
GPL (>= 2)
Authors
Gregory Demin [aut, cre], Sebastian Jeworutzki [ctb] (<https://orcid.org/0000-0002-2671-5253>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.