From maechler at stat.math.ethz.ch  Wed Apr  9 08:58:50 2014
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Wed, 9 Apr 2014 08:58:50 +0200
Subject: [Rd] attach() outputs messages to stdout - should it be stderr?
In-Reply-To: <CAFDcVCSP+cZR0XHErX_5GEq4AEbgrw209PwM0ae7MFMNaVidzw@mail.gmail.com>
References: <CAFDcVCTOCzGZYoZjGPxbkv+h_CJyLQ=4zNGwrfV351RkETw07g@mail.gmail.com>
	<21314.25707.909655.571485@stat.math.ethz.ch>
	<CAFDcVCSP+cZR0XHErX_5GEq4AEbgrw209PwM0ae7MFMNaVidzw@mail.gmail.com>
Message-ID: <21316.61354.200139.724425@stat.math.ethz.ch>

>>>>> Henrik Bengtsson <hb at biostat.ucsf.edu>
>>>>>     on Mon, 7 Apr 2014 08:20:27 -0700 writes:

    > On Mon, Apr 7, 2014 at 1:40 AM, Martin Maechler
    > <maechler at stat.math.ethz.ch> wrote:
    >>>>>>> Henrik Bengtsson <hb at biostat.ucsf.edu> on Sun, 6 Apr
    >>>>>>> 2014 21:33:15 -0700 writes:
    >> 
    >> > Contrary to other functions in 'base', attach() output
    >> > messages to stdout instead of stdout, e.g.
    >> 
    >> >> a <- 1 capture.output(attach(list(a=1))) > [1] "The
    >> following object is masked _by_ .GlobalEnv:" > [2] "" >
    >> [3] " a"
    >> 
    >> > Shouldn't this message go to stderr?
    >> 
    >> well, it this is changed... it should be changed to use
    >> message() really -- as library() does.
    >> 
    >> Then, it will not only go to stderr, but also be
    >> something you can e.g. use suppressMessages( . )  with.
    >> 
    >> I tend to agree to change this from cat() to message(),
    >> and will do so after a bit of waiting..

    > Thanks - sounds good.

    > I proposed cat(..., file=stderr()) rather that message(),
    > because I saw it was used in several other place in 'base'
    > - left overs from a earlier era?

partly, probably.  In principle you / we should not only look in
'base' but all "base packages", i.e. all in

       installed.packages(priority = "base")

Yesterday, I have committed the change -- to use  message() --
to R-devel, i.e., of course too late to make it into 
R 3.1.0, released tomorrow.

Martin



[Rd] attach() outputs messages to stdout - should it be stderr?
Martin Maechler