While haven is a great package it uses tibbles as basic data structures. Older R users (as myself) might prefer a more archaic structures. This function returns SPSS files in form of a data.frame and the nominal variables as factors.

ReadSPSS(fn, encoding = NULL)

Arguments

fn

Either a path to a file, a connection, or literal data (either a single string or a raw vector).

encoding

The character encoding used for the file. The default, NULL, use the encoding specified in the file, but sometimes this value is incorrect and it is useful to be able to override it.

Value

A data frame.

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.

Author

Andri Signorell <andri@signorell.net>

See also