collapse_a_factor: Summarize all of the values of a category

View source: R/collapse_a_factor.R

collapse_a_factorR Documentation

Summarize all of the values of a category

Description

Summarize all of the values of a category

Usage

collapse_a_factor(
  .x,
  group_to_collapse,
  values_to_summarize,
  collapsed_label,
  .summary_f = sum,
  ...
)

Arguments

.x

a tibble

group_to_collapse

the name of the field whose categories will be collapsed

values_to_summarize

the name(s) of the fields with values to summarize

collapsed_label

the name of the new, collapsed category

.summary_f

the summary function, defaults to 'sum'

...

further arguments for '.summary_f', e.g. 'na.rm = TRUE'.

Value

a new summary tibble


higherX4Racine/hiRx documentation built on Nov. 18, 2024, 10:20 a.m.