powered by
Replaces factor levels with arbitrary numeric identifiers. Neither the values nor the order of the levels are preserved.
fct_anon(f, prefix = "")
A factor.
A character prefix to insert in front of the random labels.
gss_cat$relig |> fct_count() gss_cat$relig |> fct_anon() |> fct_count() gss_cat$relig |> fct_anon("X") |> fct_count()
Run the code above in your browser using DataLab