ref_level {baizer} | R Documentation |
relevel a target column by another reference column
Description
relevel a target column by another reference column
Usage
ref_level(x, col, ref)
Arguments
x |
tibble |
col |
target column |
ref |
reference column |
Value
tibble
Examples
cut_level <- mini_diamond %>%
dplyr::pull(cut) %>%
unique()
mini_diamond %>%
dplyr::mutate(cut = factor(cut, cut_level)) %>%
dplyr::mutate(cut0 = stringr::str_c(cut, "xxx")) %>%
ref_level(cut0, cut)
[Package baizer version 0.8.0 Index]