Learn R Programming

xfun (version 0.48)

msg_cat: Generate a message with cat()

Description

This function is similar to message(), and the difference is that msg_cat() uses cat() to write out the message, which is sent to stdout() instead of stderr(). The message can be suppressed by suppressMessages().

Usage

msg_cat(...)

Value

Invisible NULL, with the side-effect of printing the message.

Arguments

...

Character strings of messages, which will be concatenated into one string via paste(c(...), collapse = '').

See Also

This function was inspired by rlang::inform().

Examples

Run this code
{
    # a message without a newline at the end
    xfun::msg_cat("Hello world!")
    # add a newline at the end
    xfun::msg_cat(" This message appears right after the previous one.\n")
}
suppressMessages(xfun::msg_cat("Hello world!"))

Run the code above in your browser using DataLab