count.dtplyr_step {dtplyr} | R Documentation |
Count observations by group
Description
This is a method for the dplyr count()
generic. It is translated using
.N
in the j
argument, and supplying groups to keyby
as appropriate.
Usage
## S3 method for class 'dtplyr_step'
count(x, ..., wt = NULL, sort = FALSE, name = NULL)
Arguments
x |
|
... |
< |
wt |
<
|
sort |
If |
name |
The name of the new column in the output. If omitted, it will default to |
Examples
library(dplyr, warn.conflicts = FALSE)
dt <- lazy_dt(dplyr::starwars)
dt %>% count(species)
dt %>% count(species, sort = TRUE)
dt %>% count(species, wt = mass, sort = TRUE)
[Package dtplyr version 1.3.1 Index]