ticked_table: Produce a dataframe to summarise ticked variables

ticked_tableR Documentation

Produce a dataframe to summarise ticked variables

Description

Takes a dataframe and produces the number and percentage for ticked variables.

Usage

ticked_table(
  df = .,
  ...,
  group = .,
  sep = .,
  digits = 1,
  condense = FALSE,
  total = TRUE
)

Arguments

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

[Deprecated] condense = TRUE is deprecated, use condense() instead.

total

Logical indicating whether a total column should be created

Value

A tibble data frame summarising the data

Examples

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)


EstherHerbert/Useful.functions documentation built on June 11, 2025, 11:19 p.m.