Skip to content
Prev 55524 / 398500 Next

boxplot() from list

Dear Laura,

You don't say what kind of "objects" are in the list, but suppose that they
are matrices; here's a scaled-down example using 3 list elements:

M1 <- matrix(rnorm(30*4), 48, 4)
M2 <- matrix(rnorm(30*4), 48, 4)
M3 <- matrix(rnorm(30*4), 48, 4)
L <- list(M1=M1, M2=M2, M3=M3)

par(mfrow=c(3, 4))
lapply(L, function(x) apply(x, 2, boxplot))

I hope that this helps,
 John