Convert a given factor to an accepted index

use_index(x)

Arguments

x

A character or a factor to be used as index

See also

You can use evaluate_index() to evaluate how good an index is. For the inverse look at batch_names().

Examples

plates <- c("P1", "P2", "P1", "P2", "P2", "P3", "P1", "P3", "P1", "P1") use_index(plates)
#> $P1 #> [1] 1 3 7 9 10 #> #> $P2 #> [1] 2 4 5 #> #> $P3 #> [1] 6 8 #>