casperyc wrote: > > Hi all, > > ########################################## > dof=c(1,2,4,8,16,32) > Q5=matrix(rt(100,dof),100,6,T,dimnames=list(NULL,dof)) > par(mfrow=c(2,6)) > apply(Q5,2,hist) > myf=function(x){ qqnorm(x);qqline(x) } > apply(Q5,2,myf) > ########################################## > > Apart from using a loop, is there are fast way to 'add' the titles to be > more informative? > >
If you type "apply" (no ()) you will find that it is not much more than an decorated generic loop. I believe that this is case where using a loop. Otherwise, you could convert you matrix to a data frame, add the degrees of freedom.... too much work for a loop where plotting anyway has the largest overhead. Others may disagree, but I believe the apply-wars have ended at the time when browser wars ended. Dieter -- View this message in context: http://r.789695.n4.nabble.com/use-of-apply-for-hist-tp3093811p3093847.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org 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.