Closed thibautjombart closed 4 years ago
In the following minimal example:
top_values(factor(c('a', 'b'))[-1], n = 1) #> [1] b #> Levels: b other
The levels should not include other, but only b. This is likely related to this warning, happening in conjunction with subset:
other
b
subset
x <- c("b", "b", "b") x_subset <- c(FALSE, TRUE, TRUE) top_values(x = x, n = 1, subset = x_subset) #> [1] "b" "b" "b" #> Warning message: #> Unknown levels in `f`: other
@zkamvar Great if you can have a look at some point.
In the following minimal example:
The levels should not include
other
, but onlyb
. This is likely related to this warning, happening in conjunction withsubset
: