ticked_table | R Documentation |
Takes a dataframe and produces the number and percentage for ticked variables.
ticked_table(
df = .,
...,
group = .,
sep = .,
digits = 1,
condense = FALSE,
total = TRUE
)
df |
Data Frame |
... |
Variables to be summarised |
group |
Optional variable that defines the grouping |
sep |
Optional separator between columns for splitting variable into variable and scoring. See ?tidyr::separate for more information. |
digits |
Number of digits to the right of the decimal point |
condense |
should the |
total |
Logical indicating whether a total column should be created |
A tibble data frame summarising the data
df <- data.frame(
pet_cat = sample(c("Ticked", ""), size = 100, replace = TRUE),
pet_dog = sample(c("Ticked", ""), size = 100, replace = TRUE),
pet_pig = sample(c("Ticked", ""), size = 100, replace = TRUE),
group = sample(c("A", "B", "C"), size = 100, replace = TRUE)
)
ticked_table(df, pet_cat, pet_dog, group = group, sep = "_")
ticked_table(df, pet_pig, pet_dog)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.