Re: [R] vector in filename

From: [Ricardo Rodriguez] Your XEN ICT Team <webmaster_at_xen.net>
Date: Fri, 18 Apr 2008 09:59:52 +0200

Hi,

Simon Blomberg wrote:
> How about this:
>
> x <- 1
> y <- 1
> mmax <- 10
>
> my.files <- paste("foo", x:mmax, ".png", sep="")
>
> for (i in my.files) {
> png(filename=i, pointsize=20, width=600, height=600, units="px",
> bg="#eaedd5")
> plot(x, y)
> dev.off()
> x <- x+1
> y <- y+1
> }
>

It does the trick! Thanks.
> Normally I would avoid for loops, but I think this application is a
> legitimate use.

Please, why do you avoid looping normally? Thanks again.

Greetings,

Ricardo

-- 
Ricardo Rodríguez
Your XEN ICT Team

______________________________________________
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 Fri 18 Apr 2008 - 08:06:49 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 Fri 18 Apr 2008 - 08:30:30 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