Count distinct entries in one or more variables, grouped by other variables
Source:R/overlap-counters.R
count_uniqueby.RdCount distinct entries in one or more variables, grouped by other variables
Arguments
- df
A data frame.
- vars
Column(s) (tidy-evaluated) whose distinct entries are counted, e.g.
Sampleorc(Sample, Patient).- by
Column(s) (tidy-evaluated) to group by.
- total
Logical; if
TRUE, an extra set of rows is appended with everybycolumn collapsed to"Total", giving an overall count alongside the per-group ones.- sep
Separator used when building the output column names (
"<fn><sep><col>", e.g."n_Sample").