[R] variable object naming

Benjamin M. Osborne Benjamin.Osborne at uvm.edu
Mon Nov 22 06:11:13 CET 2004


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

Thanks,
Ben Osborne

--
Botany Department
University of Vermont
109 Carrigan Drive
Burlington, VT 05405

benjamin.osborne at uvm.edu
phone: 802-656-0297
fax: 802-656-0440




More information about the R-help mailing list