Writing out in loops
I would like to write some data to different files. I can create the
filename Day1.txt like this:
filen <- paste("Day", l, ".txt", sep="")
and then I'm using a For loop to write out one row of a matrix,
something like this:
For (j in 1:10)
{
cat(mat[1,j], ",", file=filen, append=TRUE)
}
cat("\n", file=filen, append=TRUE)
but is there a better way to do this?
Thank you,
Thomas