Count the number of unique values of one ore more variables by groups.

count_by(data, vars, by, max_n = Inf)

Arguments

data

A dataset returned by ecdata::pin_nsclc() and preprocessed using preprocess().

vars

A character vector indicating the variables to count unique values for.

by

Columns to group by.

max_n

The maximum number of values in a group in the returned data.

Value

A dplyr::tibble.