Got it , thanks!

 

From: David Winsemius [via R]
[mailto:ml-node+2992845-2070125287-199...@n4.nabble.com] 
Sent: Tuesday, October 12, 2010 3:28 PM
To: Steve Swope
Subject: Re: Plotting Y axis labels within a loop

 


On Oct 12, 2010, at 5:54 PM, Steve Swope wrote: 


> 
> When I plot y axis labels with in a loop they (I) get confused. Here

> is some 
> sample code: 
> 
> Fe<-c(1.1, 4.5, 7.2, 8.8) 
> Mn<-c(9.6, 7.2, 5.3, 2.1) 
> Cd<-c(2.2, 3.4, 6.1, 3.2) 
> FeMnCd<-data.frame(Fe, Mn, Cd) 
> 
> par(mfrow=c(2,2)) 
> 
> for(i in FeMnCd)plot(i, xlab="Event",ylab=colnames(FeMnCd)[i]) 
> 
> The more plots per page, the crazier it gets! TIA 


Think about what will be assigned to "i" and perhaps even print it to   
your console, since it's not what you apparently expect: 

  for(i in FeMnCd){print(i); plot(i, xlab="Event",ylab=colnames(FeMnCd) 
[i]) } 

The source of you confusion may become more clear. 


> 
> Steve 
> -- 
> View this message in context:
http://r.789695.n4.nabble.com/Plotting-Y-axis-labels-within-a-loop-tp299
2813p2992813.html
<http://r.789695.n4.nabble.com/Plotting-Y-axis-labels-within-a-loop-tp29
92813p2992813.html?by-user=t> 
> Sent from the R help mailing list archive at Nabble.com. 
> 
> ______________________________________________ 
> [hidden email] 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. 


David Winsemius, MD 
West Hartford, CT 

______________________________________________ 
[hidden email] 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. 



________________________________

View message @
http://r.789695.n4.nabble.com/Plotting-Y-axis-labels-within-a-loop-tp299
2813p2992845.html 
To unsubscribe from Plotting Y axis labels within a loop, click here
<http://r.789695.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_b
y_code&node=2992813&code=c3RldmVAcGd3Zy5jb218Mjk5MjgxM3wtMTYxNzE0MDA0Mw=
=> . 

 


-- 
View this message in context: 
http://r.789695.n4.nabble.com/Plotting-Y-axis-labels-within-a-loop-tp2992813p2993979.html
Sent from the R help mailing list archive at Nabble.com.

        [[alternative HTML version deleted]]

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

Reply via email to