Learn R Programming

crayon (version 1.5.3)

style: Add style to a string

Description

See names(styles), or the crayon manual for available styles.

Usage

style(string, as = NULL, bg = NULL)

Value

Styled character vector.

Arguments

string

Character vector to style.

as

Style function to apply, either the function object, or its name, or an object to pass to make_style().

bg

Background style, a style function, or a name that is passed to make_style().

Examples

Run this code
## These are equivalent
style("foobar", bold)
style("foobar", "bold")
bold("foobar")

Run the code above in your browser using DataLab