These are methods for the dplyr count() and tally() generics. They wrap up group_by.tbl_lazy(), summarise.tbl_lazy() and, optionally, arrange.tbl_lazy().
## S3 method for class 'tbl_lazy'count(x,..., wt =NULL, sort =FALSE, name =NULL)## S3 method for class 'tbl_lazy'add_count(x,..., wt =NULL, sort =FALSE, name =NULL, .drop =NULL)## S3 method for class 'tbl_lazy'tally(x, wt =NULL, sort =FALSE, name =NULL)
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, or functions of variables. Use desc() to sort a variable in descending order.
wt: <data-masking> Frequency weights. Can be NULL or 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 called n, it will use nn. If there's a column called n and nn, it'll use nnn, and so on, adding ns until it gets a new name.