[R] Ploting in for() loop

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Sat May 25 07:54:38 CEST 2002


Suppose I have a for() loop that draws 6 boxplots as follows:
  par(mfrow = c(2, 3))
  for(i in 2:length(spam.sample)) {
    boxplot(split(spam.sample[,i], yesno))

Where spam.sample is a data frame with 7 columns, and I'm interested in
plotting column 2 ~ 7 against column 1 (yesno).

The boxplots appeared fine, however I'm trying to add a meaningful title,
x and y labels to them.  Is it possible to do this in the loop?



Ko-Kang Kevin Wang
Postgraduate PGDipSci Student
Department of Statistics
University of Auckland
New Zealand

Homepage: http://www.stat.auckland.ac.nz/~kwan022

E-mail: kwan022 at stat.auckland.ac.nz

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