powered by
tab_plain
Prepare data for tab_plain.
tab_prepare( data, ..., na_drop_all, cleannames = NULL, rare_to_other = FALSE, n_min = 30, other_level = "Others" )
A dataframe.
Variables then to be passed in tab_plain.
<tidy-select> Removes all observation with a NA in any of the chosen variables.
NA
Set to TRUE to clean levels names, by removing prefix numbers like "1-", and text in parentheses.
TRUE
"1-"
When set to TRUE, levels with less count than n_min will be merged into an "Other" level.
n_min
The count under which a level is aggregated in the "Other" level.
The name of the "Other" level, as a character vector of length one.
A modified data.frame.
# NOT RUN { data <- dplyr::starwars %>% tab_prepare(sex, hair_color, gender, rare_to_other = TRUE, n_min = 5, na_drop_all = sex) data # }
Run the code above in your browser using DataLab