[R] Re: [S] tapply for matrices

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Oct 10 22:39:27 CEST 2002

Frank E Harrell Jr <fharrell at virginia.edu> writes:

> Tony Plate provided what seems to be a very fast and elegant solution - see below.  I have modified his solution slightly:
> mapply <- function(X, INDEX, FUN=NULL, ..., simplify=TRUE) {
> ## Matrix tapply

Before this propagates too far: The name "mapply" has also been
suggested for a "multiple apply", which is like lapply/sapply but
takes multiple X arguments and a FUN of several arguments. So
perhaps matrix.apply() or so would be better?

   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list