get_spss: Load spss data with labels converted to factors

Description Usage Arguments Details Value Examples

View source: R/library neale.R

Description

This function loads an spss .sav file, and creates a dataframe with the description, type and labels of all variables in the data file. This function automatically applies as_factor to the data, converting all variables with labels in spss to factors in R.

Usage

1

Arguments

file

A characater string with the location of the spss file to be loaded.

Details

To convert labels to factors function haven::as_factor(.,only_labelled = TRUE,ordered=TRUE) is used. For details, see ?as_factor.

The dataframe with the description of all variables contains the following information:

Value

A list with two components:

Examples

1
2
3
4
5
spss.data <- get_spss(file)$sav

spss <- get_spss(file)
spss.data <- spss$sav
spss.vars <- spss$vars

neale-eldash/neale documentation built on May 23, 2019, 1:29 p.m.