[R] Beginner help about output in R

Michael Weylandt michael.weylandt at gmail.com
Fri Nov 9 00:46:18 CET 2012



On Nov 8, 2012, at 9:14 PM, nicolapon <niqo at msn.com> wrote:

> Dear R experts,
> 
> I am a beginner with R and I have a question regarding the output of a
> function.
> 
> Basically, I created 2 functions, value1 and value2, that calculate two
> values, and I would like to print those two values to an output datafile. I
> tryed the following function:
> 
> function (x) {write.table(data.frame(value1(x),value2(x)),file=output.txt)}
> 

Type ?write.table and then add

append=TRUE

to your function call. 

Michael Weylandt

> My problem is that I would like to calculate those values for different
> values of x and to get one line in the output file per value.
> When I use this function for the second time, it erases the value of the
> first try, etc. How can I proceed so that I will add a new line to the
> output at every step instead of deleting the previous line?
> 
> Thank you very much for your answers!
> 
> Nicolas
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Beginner-help-about-output-in-R-tp4648969.html
> 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 http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list