Extract variable metadata from a psych350data dataset
Description
Calls the dataset’s labelling function (via apply_spss_metadata) to get variable labels and value labels, without modifying the actual data.
Usage
get_variable_metadata(data, dataset_name, vars)
Arguments
data
|
A data frame from psych350data (pre-prep_data). |
dataset_name
|
The dataset name string passed to apply_spss_metadata, e.g. "superman", "hotones". |
vars
|
Character vector of variable names to extract metadata for. |
Value
A named list, one element per variable, each containing:
- name
- Variable name
- label
- Variable label string
- value_labels
- Named numeric vector of value labels, or NULL
- missing
- Logical, whether any values were NA in the original data