allows option to manually set the first level of the factor, for consistency with yardstick which automatically considers the first level as the "positive class" when evaluating classification.
set_fct(
.data,
...,
first_level = NULL,
order_fct = FALSE,
labels = NULL,
max_levels = Inf
)
# S3 method for data.frame
set_fct(.data, ..., first_level = NULL, order_fct = FALSE, max_levels = Inf)
# S3 method for default
set_fct(.data, ..., first_level = NULL, order_fct = FALSE, max_levels = Inf)
dataframe
tidyselect (default selection: all character columns)
character string to set the first level of the factor
logical. ordered factor?
chr vector of labels, length equal to factor levels
integer. uses fct_lump_n
to limit the number of categories. Only the top max_levels
are preserved, and the rest being lumped into "other"
tibble