Read in a GESIS SPSS file

Read in an SPSS file archived in GESIS and change the variables to R classes for further use.

gesis_spss_read(
  path = NULL,
  zacat_id = NULL,
  rename = TRUE,
  unique_id = TRUE,
  conversion = "labelled"
)

Arguments

path

An object to be converted to character

zacat_id

Default to NULL. Not used in this instance of the method.

rename

Default to TRUE which creates machine-readable variable names from the original SPSS variable names with calling the function canonical_name_create. If you set it to FALSE it will create serial variable names, given that the SPSS file names cannot be directly used because of the their special characters.

unique_id

It makes sense to call harmonize the variable name which contains the unique, serial identifier within the SPSS file. Defaults to TRUE which calls unique_id_create.

conversion

Defaults to 'labelled'. 'factor' converts all SPSS labelled variables to factors. Alternative is 'character' which behaves better with visualization.

Value

A tibble (data.frame) with R classes defined by the user in the case of non-numeric data (i.e.'labelled', 'factor', or 'character')

Examples

if (FALSE) { ##use your own file: gesis_spss_read( path = file.path ( 'not_included', 'example.sav'), zacat_id = NULL ) }