powered by
splat(flat)
hp_per_cyl <- function(hp, cyl, ...) hp / cyl splat(hp_per_cyl)(mtcars[1,]) splat(hp_per_cyl)(mtcars) f <- function(mpg, wt, ...) data.frame(mw = mpg / wt) ddply(mtcars, .(cyl), splat(f))
Run the code above in your browser using DataLab