Skip to contents

A pipe-friendly wrapper of aggregate when using formula as input.

Usage

do_aggregate(x, ...)

Arguments

x

an R object

...

other parameters passed to aggregate

Value

Results from aggregate

See also

Examples


library(magrittr)
data(ToothGrowth)

ToothGrowth %>%
  do_aggregate(len ~ ., mean)
#>   supp dose   len
#> 1   OJ  0.5 13.23
#> 2   VC  0.5  7.98
#> 3   OJ  1.0 22.70
#> 4   VC  1.0 16.77
#> 5   OJ  2.0 26.06
#> 6   VC  2.0 26.14