Skip to content
Prev 60459 / 63421 Next

aggregate.formula and pipes

Because aggregate.formula has a formula argument but the generic
has an x argument neither of these work:

  mtcars |> aggregate(x = mpg ~ cyl, FUN = mean)
  mtcars |> aggregate(formula = mpg ~ cyl, FUN = mean)

This does work:

  mtcars |> stats:::aggregate.formula(formula = mpg ~ cyl, FUN = mean)

Suggest that aggregate.formula be exported.

--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com