message

message(…)
Create a diagnostic message, often from within a function, where the text output is red.
  • – A series of arguments that can be coerced into character strings. These arguments will be pasted together with no separator and then output in red.

Example. Two simple implementations of message.
> x <- 5
> message("The answer is ", 5)
The answer is 5
> 
> fcn <- function(x){
+   message("fcn's argument:\n", x)
+ }
> 
> fcn("Red grabs attention")
fcn's argument:
Red grabs attention
> 

Leave a Reply