colour_string: Prepare multicolour string for ggtext

View source: R/colour_string.R

colour_stringR Documentation

Prepare multicolour string for ggtext

Description

Writes html tags around phrases in a string to show those phrases in a different colour

Usage

colour_string(original, to_colour = NULL)

Arguments

original

the string of text (e.g. a plot title or annotation)

to_colour

a named vector of colours. The names of each colour are the words in the text that will be drawn that colour.

Value

the string with html tags to add colour to the specified words


bbcuffer/rcutils documentation built on Nov. 10, 2023, 12:08 p.m.