Skip to contents

turn character into factor, sort factor levels and replace NA level

Usage

tidy_factor(x, level_sorting = c("frequency", "alphabet")[1])

Arguments

x

character vector to be turned to factor

level_sorting

sorting of factor levels; two options: "frequency" (default) and "alphabet"; level "Unbekannt" is always always at the end