Skip to content
Prev 286236 / 398502 Next

Aggregate with Function List ?

On Feb 23, 2012, at 1:41 PM, Michael Karol wrote:

            
Perhaps something like this?

MeansByDoseDayTime <- aggregate(as.double(DF$Concentration), by =
list(DF$Dose, DF$Day, DF$Time), FUN =
       function(x) c( mean(x, trim = 0, na.rm = T, weights=NULL),
                      sd(x, na.rm=TRUE),
                      median(x, na.rm=TRUE),
                      min(na.rm=TRUE),
                      max(x, na.rm=TRUE)
                    )
         )
David Winsemius, MD
West Hartford, CT