View source: R/na_range_to_values.R
| na_range_to_values | R Documentation |
Ensure consistency between SPSS-style missing value ranges ('na_range') and explicit missing values ('na_values') for labelled survey vectors.
na_range_to_values(x)
x |
A labelled vector created with [haven::labelled_spss()] or 'retroharmonize_labelled_spss_survey'. |
When both attributes are present, this function:
adjusts the missing range if it conflicts with existing missing values,
derives missing values from the range when necessary,
leaves non-SPSS-labelled vectors unchanged.
This harmonization is important before joining, binding, or summarizing survey data.
The input vector with harmonized 'na_values' and 'na_range' attributes. If no harmonization is needed, 'x' is returned unchanged.
[labelled::na_range()], [labelled::na_values()], [as_numeric()]
Other variable label harmonization functions:
label_normalize()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.