Open
Description
Current implementation has fct_infreq
locked in descending order. Request is to passthrough an argument to order
allowing both directions.
Current version is:
fct_infreq <- function(f, w = NULL, ordered = NA) {
f <- check_factor(f)
w <- compute_weights(f, w)
check_bool(ordered, allow_na = TRUE)
lvls_reorder(f, order(w, decreasing = TRUE), ordered = ordered)
}
Example with update would be something like:
fct_infreq <- function(f, w = NULL, ordered = NA, desc = TRUE) {
f <- check_factor(f)
w <- compute_weights(f, w)
check_bool(ordered, allow_na = TRUE)
lvls_reorder(f, order(w, decreasing = desc), ordered = ordered)
}