Number of observations in each group
Helper function that can be used to find counts by group.
Can be used inside summarize.()
, mutate.()
, & filter.()
n.()
test_df <- data.table( x = 1:3, y = 4:6, z = c("a","a","b") ) test_df %>% summarize.(count = n.(), .by = z) # The dplyr version `n()` also works test_df %>% summarize.(count = n(), .by = z)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.