set_var_levels {xpose.xtras} | R Documentation |
Set variable levels
Description
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
>.
Usage
set_var_levels(
xpdb,
.problem = NULL,
...,
.missing = "Other",
.handle_missing = c("quiet", "warn", "error")
)
Arguments
xpdb |
< |
.problem |
< |
... |
< |
.missing |
< |
.handle_missing |
< |
Value
<xp_xtras
> object with updated levels
Examples
set_var_levels(xpdb_x,
SEX = lvl_sex(),
MED1 = lvl_bin(),
MED2 = c(
0 ~ "n",
1 ~ "y"
)
)
[Package xpose.xtras version 0.0.2 Index]