Description Usage Arguments Details Value Examples
Safe version of as_factor.
1 |
x |
labelled vector |
Safe version of as_factor. This function keeps unlabelled values and does not replace them with NA as 'as_factor' in 'haven' package. It also avoids "duplicated levels" warning.
TRUE/FALSE
1 2 | x <- haven::labelled(c(1, 1, 2, 3, 4), c(Male = 1, Male = 2, Female = 3))
as_factor_safe(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.