I solved this problem using Sys.getpid() function.
zz <- file(paste(cmd_args[7],Sys.getpid(),".txt",sep=""), "at")
write(rr,file=zz)
close(zz)
--
View this message in context:
http://r.789695.n4.nabble.com/Saving-data-into-a-text-or-CSV-file-using-foreach-doSNOW-tp3683155p3690132.html
Sent from
Dear list,
I am using the foreach/doSNOW packages. I want to compute some data parallel
and save results in every iteration into a text or CSV file, but then I see
in file there are some errors (some data is not saved to file and there are
empty lines). I have tested every function to append dat