Mimics dplyr::count using base R and rlang

b_count(x, ..., wt = NULL, sort = FALSE)

# S3 method for default
b_count(x, ..., wt = NULL, sort = FALSE)

# S3 method for split_df
b_count(x, ..., wt = NULL, sort = FALSE)

Arguments

x

data.frame

...

variables to group by

wt

numeric, weights to count by, Default: NULL

sort

boolean, if TRUE will sort output in descending order of n, default = FALSE

Value

data.frame

See also

Examples

airquality%>% b_count(Month,Temp)%>% head()
#> Month Temp n #> 1 5 56 1 #> 2 6 56 0 #> 3 7 56 0 #> 4 8 56 0 #> 5 9 56 0 #> 6 5 57 3