[R] Ploting in for() loop

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Sat May 25 13:15:42 CEST 2002


Thanks John, and Uwe,

On Sat, 25 May 2002, John Fox wrote:

> Date: Sat, 25 May 2002 07:13:05 -0400
> From: John Fox <jfox at mcmaster.ca>
> To: Ko-Kang Kevin Wang <kwan022 at stat.auckland.ac.nz>
> Cc: R Help <r-help at stat.math.ethz.ch>
> Subject: Re: [R] Ploting in for() loop
> 
> Dear Kevin,
> 
> You could try something like:
> 
>      names=colnames(spam.sample)
>      titles=LETTERS[1:6]
>      par(mfrow = c(2, 3))
>      for(i in 2:length(spam.sample)) {
>          boxplot(split(spam.sample[,i], yesno),
>              xlab=names[1], ylab=names[i], main=titles[i-1])
>          }
> 
> Of course, the titles would be replaced with meaningful text.
> 
> Is that what you want?

This is exactly what I want.  I actually found one possible solution 30
minutes after I sent the e-mail.  But I didn't post a message to announce
that as I'd like to see other possible solutions, and I'm glad I made that
choice!

Cheers,

Kevin

------------------------------------------------------------------------------
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