Skip to contents

Function adds html code around the selected string adding options for colorized and/or bold display in HTML documents.

Usage

format_text(text, color = "auto", bold = TRUE)

Arguments

text

Text string that you want to format

color

Color name, for "auto" the color will be determined based on the number parsed - red for negative, green for positive

bold

Make text bold or not

Value

text with HTML tags

Examples

text <- format_text("1.2%", color = "auto", bold = TRUE)
text
#> [1] "<b><span style='color: green;'>1.2%</span></b>"