Learn R Programming

forcats (version 0.5.2)

fct_shuffle: Randomly permute factor levels

Description

Randomly permute factor levels

Usage

fct_shuffle(f)

Arguments

f

A factor (or character vector).

Examples

Run this code
f <- factor(c("a", "b", "c"))
fct_shuffle(f)
fct_shuffle(f)

Run the code above in your browser using DataLab