[R] Usage of sink()

My List mylisttech at gmail.com
Fri Jun 26 09:07:12 CEST 2015


All:

I have the following code segment.

msg <- file("msg.txt", open="wt")
out   <- file("out.txt", open="wt")
sink(msg, type="message")
sink(out, type="output")
write("write() to stderr", stderr())
write("write() to stdout", stdout())

This works fine, when I want the messages to goto mes.txt and output to
out.xt.

My desire is now to get to send both the output and messages( i.e stdout
and stderr) to ONE file.

How do I accomplish this?

Thanks in Advance,
- Harmeet

	[[alternative HTML version deleted]]



More information about the R-help mailing list