Randomly permute factor levels

fct_shuffle(f)

Arguments

f

A factor

Examples

f <- factor(c("a", "b", "c")) fct_shuffle(f)
#> [1] a b c #> Levels: c a b
fct_shuffle(f)
#> [1] a b c #> Levels: b a c