[R] vector in filename

[Ricardo Rodriguez] Your XEN ICT Team webmaster at xen.net
Fri Apr 18 16:21:24 CEST 2008


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!!!!
>        dev.off()  }
>

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

-- 
Ricardo Rodríguez
Your XEN ICT Team



More information about the R-help mailing list