[R] macro variable in R?

karena dr.jzhou at gmail.com
Thu Apr 22 18:08:20 CEST 2010

I need to create 10 matrices. say matrix 1-10.

matrix_1 is 1 by 1
matrix_2 is 2 by 2
matrix_3 is 3 by 3
matrix_10 is 10 by 10

I am just wondering if there are some functions in R that are similar to the
macro variables in SAS. so I can create these 10 matrices by doing:
for (i in 1: 10) {
matrix_$i <- matrix(nrow=i, ncol=i)

rather thank creating these matrices one by one manually.

Anyone have any suggestions?



View this message in context: http://r.789695.n4.nabble.com/macro-variable-in-R-tp2020772p2020772.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list