Learn R Programming

lares (version 5.1.0)

formatColoured: Print Coloured Messages

Description

Print Coloured Messages

Usage

formatColoured(txt, colour = c("blue", "yellow", "grey"), cat = TRUE)

Arguments

txt

Character. Text to print or transform.

colour

Character. Any of: grey, red, green, yellow, blue, or purple.

cat

Boolean. Print with cat? If not, raw string

Value

Depends on cat: NULL if TRUE or character string if FALSE.

Examples

Run this code
# NOT RUN {
opts <- c("GREY", "RED", "GREEN", "YELLOW", "BLUE", "PURPLE")
for (colour in opts) formatColoured(paste("Colour:", colour, "\n"), colour)
# }

Run the code above in your browser using DataLab