Counts rows per group (or overall), optionally the number of distinct values of a column and the rows per distinct value, the share of all counted rows, and counts of selected values of further columns.
Arguments
- data
A data frame.
- by
Grouping columns (none for one overall row).
- filter
Optional named list of columns and values selecting rows.
- distinct
Optional column whose distinct values are counted.
- tally
Optional named list of extra counts: each a list of
columnandvalues.- scale
Multiplier of the share (100 for percentages).
Value
A data frame with the groups, n, share, and if requested
n_distinct, n_per_distinct (integer division) and the tallies.
See also
Other plot-data builders:
PlotDataBindRows(),
PlotDataConstant(),
PlotDataCrossShares(),
PlotDataDirection(),
PlotDataDominant(),
PlotDataFromArrays(),
PlotDataJoin(),
PlotDataKeyColours(),
PlotDataLabels(),
PlotDataLonger(),
PlotDataMembership(),
PlotDataPairRatio(),
PlotDataProduct(),
PlotDataQuantiles(),
PlotDataRankRows(),
PlotDataRatio(),
PlotDataRecode(),
PlotDataRelative(),
PlotDataSelect(),
PlotDataShares(),
PlotDataSummarise(),
PlotDataUnite()