set_var_levels | R Documentation |
For variable types such as catcov
, it can be convenient to define
levels. This function provides a straightforward means to do so,
consistent with tidy
functions like <case_when
>.
Several convenience functions are provided for common levels in <levelers
>.
set_var_levels(
xpdb,
.problem = NULL,
...,
.missing = "Other",
.handle_missing = c("quiet", "warn", "error")
)
xpdb |
< |
.problem |
< |
... |
< |
.missing |
< |
.handle_missing |
< |
<xp_xtras
> object with updated levels
set_var_levels(xpdb_x,
SEX = lvl_sex(),
MED1 = lvl_bin(),
MED2 = c(
0 ~ "n",
1 ~ "y"
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.