Skip to content

Writing multiple matrices

2 messages · Carlos López, Jorge Ivan Velez

#
Hello all :)

I have a for loop where in each cycle I create certain matrix object, 
let?s say, X, I would like to write it
so I use the write.table function but I would like to write as many 
matrices as cycles, this is, I would like
to use a variable, let?s say y, that will be in the for, as in: for (y 
in 1:100)

and then when I write the matrix in a file I would like to produce files 
with different names, for examen

my_matrix_1.dat

my_matrix_2.dat

my_matrix_3.dat
.
.
.
my_matrix_100.dat


is there any way to do this with the write.table function?

Thank you very much in advance
Carlos