Displaying 1 result from an estimated 1 matches for "resultsmatrix_1".
Did you mean:
resultsmatrix_10
2008 Mar 13
2
Using loop numbers in write.csv
...results to a csv file after each iteration.
something like:
for (i in 1:10){
exampleMatrix <- matrix(runif(25, 0, 1),5, 5)
write.csv(exampleMatrix, file = "resultsMatrix_i.csv")
}
Where I would get 10 csv files named resultsMatrix_1, resultsMatrix_2
... resultsMatrix_10.
2) On a similar note is there a way to use the loop number when naming things.
something like:
for (i in 1:10){
exampleMatrix_i <- matrix(runif(25, 0, 1),5, 5)
}
Where I would then have 10 matrices in mem...