View source: R/convert_na_to_level.R
| convert_na_to_level | R Documentation |
NA values to "NA" for categorical variablesConvert NA values to "NA" for categorical variables
convert_na_to_level(data)
data |
A data frame or tibble |
A data frame or tibble with NA converted to "NA"
data <- data.frame(
x1 = c(1, 2, NA),
x2 = c("1", "2", NA),
x3 = factor(c("1", "2", NA)),
x4 = factor(c("b", NA, "a"), levels = c("b", NA, "a"), ordered = TRUE)
)
convert_na_to_level(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.