message
Diagnostic Messages

Description

Creates a diagnostic message using the input arguments.

Usage

message(..., domain = NULL, appendLF = TRUE)
suppressMessages(expr, classes = "message")
packageStartupMessage(..., domain = NULL, appendLF = TRUE)
.packageStartupMessage(message, call = NULL)
suppressPackageStartupMessages(expr)
.makeMessage(..., domain = NULL, appendLF = FALSE)

Arguments

... zero or more objects that can be coerced to character strings. For message, it can also be an object that inherits from the class "condition".
domain a character string specifying the domain to use for language translation. see gettext for more details.
appendLF a logical value. If TRUE (the default), a new line character is appended to the message.
expr the expression to be evaluated.
classes a vector of class names.
message a character string containing the message.
call a function call.

Details

When a message occurs, you can specify more complex behavior using the condition system, via functions such as withCallingHandlers and tryCatch. If a condition object is passed as the only argument to message, it is used to signal the event, rather than constructing a simpleMessage condition object.
Value
messagereturns NULL invisibly.
suppressMessagesreturns the value of expr.
packageStartupMessagereturns NULL invisibly.
.packageStartupMessagereturns an object of class c("packageStartupMessage", "condition", "message", "simpleMessage") with two components: message and call.
.makeMessagereturns a character string.
See Also
gettext, stop, warning, condition
Examples
message("This is a message:", 1, 2, 3, domain =  "", appendLF = TRUE) 
# print message: This is a message:123

suppressMessages(message("This is a message")) # don't print anything

packageStartupMessage("This is a package start message:", 1, 2, 3, appendLF = TRUE) # print message: This is a package start message:123

suppressPackageStartupMessages(packageStartupMessage("This is a package start message:", 1, 2, 3, appendLF = TRUE)) # don't print anything

.makeMessage("This is a message:", 1, 2, 3, appendLF = TRUE) # create message text string

.packageStartupMessage(message = .makeMessage("This is a package start message:", 1, 2, 3, appendLF = TRUE), call = NULL) # create packageStartupMessage condition

Package base version 6.0.0-69
Package Index