[R] variable object naming

Gabor Grothendieck ggrothendieck at myway.com
Mon Nov 22 06:24:50 CET 2004


Benjamin M. Osborne <Benjamin.Osborne <at> uvm.edu> writes:

: 
: Is it possible to give a temporary object a name that varies with each run 
of a
: foreloop?  For example, I want to fill a matrix every time I run a loop, and 
I
: want a new matrix with each run, with an appropriate new name.
: i.e.:
: for(i in 1:5){...  matrix.i<-some values ...}
: 
: so that in the end I would have:
: matrix.1
: matrix.2
: matrix.3
: matrix.4
: matrix.5


See 7.1 of the FAQ.




More information about the R-help mailing list