[R] plotting from dataframes

PIKAL Petr petr.pikal at precheza.cz
Fri Jan 18 10:46:09 CET 2013


Hi

> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of condor
> Sent: Friday, January 18, 2013 10:17 AM
> To: r-help at r-project.org
> Subject: Re: [R] plotting from dataframes
> 
> So by hand the command would be
> 
> par(mfrow=c(1,2))
> plot(frames$'1'hour1)
> plot(frames$'2'hour1)
> 
> But in my case there are far more than 2 days, so I want to use a loop.
> Suppose I have 10 plots
> par(mfrow=c(2,5))
> for(i in 1:10){
> plot( /what should be put here??/)

use
plot[,i]

if you want plot columns 1:10 or 

put this
col.to.plot=c(5,7,9,12,15, 17, 21, 25, 26, 30)
in front of cycle and use

plot[,col.to.plot[i]]

if you want to plot preselected columns

Regards
Petr

> }
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/plotting-
> from-dataframes-tp4655851p4655931.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list