Skip to content

aggregate data.frame using column-specific functions

3 messages · Markus Preisetanz, Jacques VESLOT, justin bem

#
you can use mapply()...

z <- as.data.frame(matrix(1:3,3,3,T))
mapply(function(x,y) x(y), c(sum,prod,sum), z)


Markus Preisetanz a ??crit :