to_fct: Convert characters to factors

Description Usage Arguments Details Examples

View source: R/radiant.R

Description

Convert characters to factors

Usage

1
to_fct(dataset, safx = 30, nuniq = 100, n = 100)

Arguments

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

Details

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

Examples

1
tibble(a = c("a", "b"), b = c("a", "a"), c = 1:2) %>% to_fct()

radiant-rstats/radiant.data documentation built on Nov. 13, 2018, 6:57 a.m.