[R] Getting sink to work with "message" on R 2.11.0 - what did I miss?

Bert Gunter gunter.berton at gene.com
Sat May 22 00:49:00 CEST 2010


I probably shouldn't be replying, as I believe this may require system
specific tricks that I don't know. To that end, you should probably provide
the minimum required information (e.g. from sessionInfo() + any other
OS/shell info) requested by the posting guide.

AFAIK, this can't be done in R. The history mechanism -- ?history --
(details of which are system dependent) records typed commands.  sink()
records output. The twain don't meet.

-- Bert 

Bert Gunter
Genentech Nonclinical Statistics

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Tal Galili
Sent: Friday, May 21, 2010 2:02 PM
To: r-help at r-project.org
Subject: [R] Getting sink to work with "message" on R 2.11.0 - what did I
miss?

Hi all,

I am trying to use type message with sink, like this:

sink("all.Rout", type="message")
1+3

sink()

readLines(con = "all.Rout")

So to get the following output:

> 1+3
[1] 4

Obviously this doesn't work.

I tried some variations (based on the explanations in the help) but am
missing something on how to make it work.

Any suggestions?

(p.s: I need this so to help Faiz Rasool in his latest post)

Thanks,

Tal



----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili at gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------
------------------

	[[alternative HTML version deleted]]

______________________________________________
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