Skip to content
Prev 258139 / 398502 Next

Eval to write many files

On 27.04.2011 13:59, Alaios wrote:
Won't be much shorter, but in loops use
seq_alonmg(Shadowlist) rather than c(1:length(Shadowlist))
In the latter, the c() is useless and 1:length(.) may become 1:0 for a 
length 0 object.

Actually I'd try:

     sa <- seq_along(Shadowlist)
     filenames <- paste('/home/apa/maps/', model, sa, '.mat', sep="")
     names(Shadowlist) <- paste(model, '_shadow', sa, sep="")
     for(i in sa)
         do.call(writeMat, c(con = filenames[i], Shadowlist[i]))


Uwe Ligges