Description Usage Arguments Details Value See Also Examples
View source: R/na_range_to_values.R
Harmonize the na_values
attribute with
na_range
, if the latter is present.
1 2 3 |
x |
A labelled_spss or labelled_spss_survey vector |
na_range_to_values()
tests if the function needs to be
called for na_values
harmonization. The na_range
is often missing and less likely to cause logical problems
when joining survey answers.
A x
with harmonized na_values
and
na_range
attributes.
If min(na_values)
or max(na_values)
than the left- and
right-hand value of na_range
, it gives a warning and adjusts
the original na_range
.
Other variable label harmonization functions:
harmonize_values()
,
harmonize_waves()
,
label_normalize()
1 2 3 4 5 6 7 8 9 10 11 | var1 <- labelled::labelled_spss(
x = c(1,0,1,1,0,8,9),
labels = c("TRUST" = 1,
"NOT TRUST" = 0,
"DON'T KNOW" = 8,
"INAP. HERE" = 9),
na_range = c(8,12))
na_range_to_values(var1)
as_numeric(na_range_to_values(var1))
as_character(na_range_to_values(var1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.