
Fast counting via dtplyr
fastcount.Rd`fastcount()` delegates [dplyr::count()] to a `data.table` backend by converting the input to a lazy `dtplyr` table first. This preserves the familiar `count()` interface while exploiting `data.table` performance.
Arguments
- x
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).
- ...
<
data-masking> Variables to group by.- wt
<
data-masking> Frequency weights. Can beNULLor a variable:If
NULL(the default), counts the number of rows in each group.If a variable, computes
sum(wt)for each group.
- sort
If
TRUE, will show the largest groups at the top.- name
The name of the new column in the output.
If omitted, it will default to
n. If there's already a column calledn, it will usenn. If there's a column callednandnn, it'll usennn, and so on, addingns until it gets a new name.