[R] tapply on multiple groups

GL pflugg at shands.ufl.edu
Thu Jan 28 16:26:06 CET 2010


Can you make tapply break down groups similar to bwplot or such? Example:

Data frame has one measure (Days) and two Dimensions (YYYYMM and Place). All
have the same length.

> length(dbs.final$Days)
[1] 3306
> length(dbs.final$Place)
[1] 3306
> length(dbs.final$YYYYMM)
[1] 3306

Doing the following makes a nice table for one dimension and one measure:

    do.call(rbind,tapply(dbs.final$Days,dbs.final$Place, summary))

But, what I really need to do is break it down on two dimensions and one
measures - effectively equivalent to the following bwplot call:

    bwplot( Days ~ YYYYMM | Place, ,data=dbs.final)

Is there an equivalent to the "|" operation in tapply?


-- 
View this message in context: http://n4.nabble.com/tapply-on-multiple-groups-tp1380593p1380593.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list