grouped_counts {flashlight} | R Documentation |
Grouped count
Description
Calculates weighted counts grouped by optional columns.
Usage
grouped_counts(data, by = NULL, w = NULL, value_name = "n", ...)
Arguments
data |
A |
by |
An optional vector of column names in |
w |
Optional name of the column in |
value_name |
Name of the resulting column with counts. |
... |
Arguments passed to |
Value
A data.frame
with columns by
and value_name
.
Examples
grouped_counts(iris)
grouped_counts(iris, by = "Species")
grouped_counts(iris, w = "Petal.Length")
grouped_counts(iris, by = "Species", w = "Petal.Length")
[Package flashlight version 0.9.0 Index]