On 2007-05-19, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
>
> sweep.median2 <- function(data.mat, group.vec, group.sel) {
>    sweep.med <- function(x) sweep(x, 2, apply(x, 2, median))
>    f <- function(g) cbind(g+0, sweep.med(data.mat[group.vec == g,,drop
>= FALSE ]))
>    do.call(rbind, lapply(group.sel, f))
> }
>

Thanks for this -- very helpful!

Tyler

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to