| message2 | R Documentation |
Add options to set color and to end execution of code (to be used as error message)
message2(..., col = "cyan", font = 1, stop = FALSE)
... |
Message content to be printed. Multiple arguments are pasted together. |
col |
text color. Default is "cyan". |
font |
Integer. 1 for plain text (default), 2 for bold text. |
stop |
Logical. If TRUE, stops execution (like |
This function prints colored messages to the console. If ANSI color codes are supported
by the terminal, the message will be colored. Otherwise, it will be printed as plain text.
If stop = TRUE, execution will be halted after printing the message.
No return value, called for side effects. Prints a colored message
to the console. If stop = TRUE, execution is halted after printing
the message.
message2("This is a plain cyan message", col = "cyan", font = 1)
message2("This is a bold cyan message", col = "cyan", font = 2)
message2("This is a bold red message", col = "red", font = 2)
cat("this will be shown")
try(message2("This stops execution", stop = TRUE), silent = TRUE)
cat("this will be shown after the try")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.