[R-sig-eco] auto graphics saving

Christian A. Parker cparker at pdx.edu
Fri Jul 4 20:11:26 CEST 2008


I am not sure about the movie question but for the write table you could 
just generate a dynamic file name, for example

for (i in 1:10)
{
X<-matrix(1:10,nrow=2)
filepath<-paste("c:\\blah\\index",i,".txt",sep="")
print(filepath)
}

-Chris



Megan O'Rourke wrote:
> I am working on a spatial simulation in R and would like to present a movie of my simulation within a ppt presentation.  With my current knowledge, I can activate "history" in the graphic output during my simulation loop and then manually save individual graphical frames of the simulation as picture files that I import into a movie making program.  Is there an easier way to save a movie in R?  
>    
>   Along that same line of questioning, is there any way to save consecutive data files automatically from within a loop?  For example, I am creating consecutive matrices in a loop that I store within a three-dimensional array within the R program.  I would like to write a line in my loop that I imagine would say something like: write.table(X, "c:\\blah\\index.txt") and the loop would output consecutive 2-dimensional layers of my array in separate files.  If I add a line similar to above, R creates one file that it rewrites over every step of the loop.  Is there a way to automate the data saving process?
>    
>   Thanks,
>    
>   Megan O'Rourke
>   PhD student, Cornell University 
>
>        
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>



More information about the R-sig-ecology mailing list