[R] Re: [S] tapply for matrices

Frank E Harrell Jr fharrell at virginia.edu
Thu Oct 10 22:47:32 CEST 2002


Good idea Peter -Frank

On 10 Oct 2002 22:39:27 +0200
Peter Dalgaard BSA <p.dalgaard at biostat.ku.dk> wrote:

> 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


-- 
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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