Re: [R] RES: Need ideas on how to show spikes in my data and how to codeit in R

From: Thomas Frööjd <tfrojd_at_gmail.com>
Date: Mon, 07 Jul 2008 12:24:44 +0200

Hi

Try changing

 for(i in 1:250){
 jpeg(filename = "graf01.jpg", width = 1024, height = 1024,

to

 for(i in 1:250){
 jpeg(filename = paste("graf", i, ".jpg", sep=""), width = 1024, height = 1024,

I think that should work, otherwise read up on the paste() function at http://stat.ethz.ch/R-manual/R-patched/library/base/html/paste.html

Best luck

On Mon, Jun 30, 2008 at 4:58 PM, Leandro Marino <leandro_at_cesgranrio.org.br> wrote:
> Hi list,
>
> I want to make a lot of graphics to my end course project. So, i was using
> this sintax:
>
>
> jpeg(filename = "graf01.jpg", width = 1024, height = 1024,
> units = "px", pointsize = 25, quality = 100, bg = "grey95",
> res = NA, restoreConsole = TRUE)
> i=1
> par(mfrow=c(4,1),col="grey90",font.lab=2)
> hist(sul[,i+2],nclass=75,xlab="Região
> Sul",ylab="Freqüência",col="antiquewhite4",main="")
> hist(PR[,i+2],nclass=75,xlab="Paraná",ylab="Freqüência",col="antiquewhite4",
> main="")
> hist(SC[,i+2],nclass=75,xlab="Santa
> Catarina",ylab="Freqüência",col="antiquewhite4",main="")
> hist(RS[,i+2],nclass=75,xlab="Rio Grande do
> Sul",ylab="Freqüência",col="antiquewhite4",main="")
> dev.off()
>
> But, I want to know how can I create an for to do that. Like that:
>
> for(i in 1:250){
> jpeg(filename = "graf01.jpg", width = 1024, height = 1024,
> units = "px", pointsize = 25, quality = 100, bg = "grey95",
> res = NA, restoreConsole = TRUE)
> par(mfrow=c(4,1),col="grey90",font.lab=2)
> hist(sul[,i+2],nclass=75,xlab="Região
> Sul",ylab="Freqüência",col="antiquewhite4",main="")
> hist(PR[,i+2],nclass=75,xlab="Paraná",ylab="Freqüência",col="antiquewhite4",
> main="")
> hist(SC[,i+2],nclass=75,xlab="Santa
> Catarina",ylab="Freqüência",col="antiquewhite4",main="")
> hist(RS[,i+2],nclass=75,xlab="Rio Grande do
> Sul",ylab="Freqüência",col="antiquewhite4",main="")
> dev.off()
> }
>
> The problem is the name of the file, I want to do something like grafi.jpg
> where i goes from 1 to 250.
>
> Thanks a lot for the help.
>
>
> Best Regards,
> Leandro Marino
>
> ______________________________________________
> 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.
>



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. Received on Mon 07 Jul 2008 - 10:43:48 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 07 Jul 2008 - 11:31:51 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive