Convert characters to factors
Convert characters to factors
to_fct(dataset, safx = 30, nuniq = 100, n = 100)
dataset |
Data frame |
safx |
Ratio of number of rows to number of unique values |
nuniq |
Cutoff for number of unique values |
n |
Cutoff for small dataset |
Convert columns of type character to factors based on a set of rules. By default columns will be converted for small datasets (<= 100 rows) with more rows than unique values. For larger datasets, columns are converted only when the number of unique values is <= 100 and there are 30 or more rows in the data for every unique value
tibble(a = c("a", "b"), b = c("a", "a"), c = 1:2) %>% to_fct()
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.