load_spss: Read SPSS file and parse factors from labels.

Description Usage Arguments Value Note Examples

View source: R/util.R

Description

Reads an SPSS file with sjmisc and then converts columns to factors.

Usage

1
2
load_spss(path, cleanLabel = NULL, rm_notAnswered = TRUE,
  parse_frame_labels = TRUE)

Arguments

path

(character), path of .sav file that should be loaded.

cleanLabel

(function), pass through a function to clean the character string of the column label.

rm_notAnswered

(logical), if TRUE the 'Not Anwered' label will not be included in factor levels if there are no instances.

parse_frame_labels

(logical), if TRUE, will attempt to parse "label" attribute into separate "label", "topic", and "category" attributes based on string patterns in SPSS Labels exported by Verint survey data.

Value

data.frame with factors and column attributes label, topic, and category.

Note

Labels and topics may be truncated if they are too long. This happens when the .sav file is generated by Verint. SPSS has a maximum length for variable labels, so those labels will be truncated in the SPSS file itself.

Examples

1
2
file_path <- "dataset.sav"
df <- load_spss(file_path)

m-dinardo/fsquant documentation built on May 21, 2019, 9:17 a.m.