Determine the level of a value in a vector of type factor

which_level(x)

Arguments

x

vectors of type factor

Value

a vector holding the corresponding level of the input factors

Examples

first <- factor(c("J", "O", "S", "H"), LETTERS) which_level(first)
#> [1] 10 15 19 8