group_by2: Group a Tibble With Inapplicable Groups

group_by2R Documentation

Group a Tibble With Inapplicable Groups

Description

Similar to dplyr::group_by(), this function groups a tibble while also marking certain groups as inapplicable.

Usage

group_by2(data, ...)

Arguments

data

A tibble to group

...

Arguments of the form var = c(val1, val2) or the name of a variable

Details

A grouped tibble has one or more grouping variables, where each unique combination of values identifies a group. This function allows some of the values to be marked inapplicable, such that the corresponding rows are not considered to be grouped on that variable at all.

Grouping variables, and inapplicable values, are passed as arguments in the form group_var = c(value1, value2, ...). Any included values will be marked inapplicable. If an argument has length 0 or is NULL, no values will be marked inapplicable.

Value

An igrouped tibble


groupr documentation built on March 31, 2023, 10:36 p.m.