Re: [R] vector in filename

From: [Ricardo Rodriguez] Your XEN ICT Team <>
Date: Fri, 18 Apr 2008 16:21:24 +0200

Hi Richard, thanks for your input!

Richard Rowe wrote:
> which figures if you look at what you are doing line by line ... try it
> try something like:
> max=10
> for (i in 1:max){
> myfiles <- paste("foo", i, ".png", sep="") # generates names
> foo1.png, foo2.png, etc
> png(file=myfiles, pointsize = 20, width = 600, height = 600, units =
> "px", bg="#eaedd5")
> plot(x[i,],y[i,]) #
> !!!!you will need to change what you are plotting to something like
> this!!!!
> }

There are at least two things I don't understand in your proposal:

  1. How x and y variate? I mean, there is not x= or y= commands prior to enter for().
  2. Whatever I set or not x and y, the code claims:

Error in x[i, ] : incorrect number of dimensions

Please, why to you use plot(x[i,],y[i,]) instead of plot(x,y)?

Thanks for your help,


Ricardo Rodríguez
Your XEN ICT Team

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 18 Apr 2008 - 15:11:06 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 - 16:30:29 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive