Skip to content
Prev 3927 / 12125 Next

[R-pkg-devel] CRAN student assistants

message() / warning() / stop() write to stderr whereas print() / cat() write (by default) to stdout. Even without being able to suppress messages, it is well-established practice (the story is that this is the reason why 'stderr' was introduced into unix, https://www.jstorimer.com/blogs/workingwithcode/7766119-when-to-use-stderr-instead-of-stdout ) to separate diagnostic messages from program output. I agree that gargle (in particular, and packages in general, given the theme of this mailing list) would be a better package if it used message() where it now uses cat().

Martin

?On 5/15/19, 5:04 AM, "R-package-devel on behalf of Joris Meys" <r-package-devel-bounces at r-project.org on behalf of Joris.Meys at ugent.be> wrote:

    2) Where cat() is used in gargle, message() is a better option for the
    following reason:
    
    > myfun <- function(){cat("Yes");message("No")}
    > suppressMessages(myfun())
    Yes
Message-ID: <BN8PR05MB61961B3B144308E50D552312F9090@BN8PR05MB6196.namprd05.prod.outlook.com>
In-Reply-To: <CAO1zAVanghCAPnJb1Dtfzvgc4SCBrJO0yUerg-2wPJkcx=rRuQ@mail.gmail.com>