text_active | R Documentation |
Active text takes a string, inserts numbers and/or words at pre-defined points in the string, and styles the inserted numbers/words with CSS. Active text is intended for use in Shiny apps.
text_active(string, numbers, colour = "#ffffff", alpha = 25, extra_style = "")
string |
A length-one character vector, with XX inserted at points where
you want the elements of |
numbers |
A vector (numeric or character) of numbers and/or words you
want to insert at the points marked XX in |
colour |
Background colour for the inserted text ( |
alpha |
Alpha (transparency) for the inserted text ( |
extra_style |
Additional CSS to style the inserted text, such as
|
Length-one character vector, with inline CSS.
string <- "The unemployment rate went up by XX percentage points to XX per cent."
numbers <- c(0.2, 6.1)
text_active(string, numbers)
text_active(string, numbers, colour = "#007b4b", alpha = 0.5)
text_active(string, numbers,
colour = "#007b4b", alpha = 0.5,
extra_style = "font-weight: bold;"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.