Skip to content

Randomly permute factor levels

Usage

fct_shuffle(f)

Arguments

f

A factor (or character vector).

Examples

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