[R] Loop Help

Özgür Asar oasar at metu.edu.tr
Mon Jun 18 18:43:08 CEST 2012


@angel,

You can try append option in write.table

for e.g.

for(i in 1:20)
write.table(i,"out.txt",append=T,sep="\t",row.names=F,col.names=F)

This will help you save your all results by writing each results on
subsequent rows.

Hope this helps
Ozgur

>Hello Jim
>thank you so much for your response.
>When I use write.csv, on the csv file is saved only the last loop
>So when I write

>results.matrix <- apply(degree_w(net.static[[i]]), 2, mean)
>write.csv(results.matrix, file = "results.csv")

>instead of getting a 550 line document with all loop results, I only get
the last one!
>Could you please help me?
>Thank you so much in advance 

--
View this message in context: http://r.789695.n4.nabble.com/Loop-Help-tp4633558p4633722.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list