Description Usage Arguments Details Value Examples
View source: R/library neale.R
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.
1 |
file |
A characater string with the location of the spss file to be loaded. |
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:
var: Variable name in SPSS and R
name: Variable label in SPSS
spss.format: Variable format in SPSS
class: Variable class in R
n.na: Number of NA
's
n.nan: Number of NaN
's
n.distinct: Number of distinct values
n.labels: Number of labels
labels: All labels concatenated and separated by ';'
labels.1 thru labels.n: each label is displayed separatly in a variable
A list with two components:
sav(dataframe): with the actual data
vars(dataframe): with the description of all variables
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.