[R] Odp: export results

Petr PIKAL petr.pikal at precheza.cz
Thu Feb 25 16:44:43 CET 2010


r-help-bounces at r-project.org napsal dne 25.02.2010 12:42:46:

> Hi all,
> I am looping through a function for 100 time in the middle of my code, 
and I
> want to output the results from this function. Is there a way to write 
> results into a txt or csv fil? For example, I write the results from the
> first loop to the first column of a spreadsheet and the results from the
> second loop to the second coclumn of a spreadsheet etc.

make a data frame, let say res

res=as.data.frame(matrix(NA, n, 100)) #predefine data frame
for (i in ...) {

some stuff
res[,i] <- some function result



> Thank you very much, 
> Wendy 
> -- 
> View this message in context: 
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list