as_dict | R Documentation |
Construct a dictionary which controls the highlighting of text.
as_dict( x, feature = "feature", bg_colour = "bg_colour", txt_colour = "txt_colour", bold = "bold", italic = "italic", strike_out = "strike_out" )
x |
A data.frame with columns of switches to determine text highlighting. Not all columns need to be present. |
feature |
Name of column that contains the words of terms to highlight. |
bg_colour |
Name of column that controls the background colour for a feature |
txt_colour |
Name of column that controls the text colour for a feature. |
bold |
Name of column that controls if a feature is printed with bold font. |
italic |
Name of column that controls if a feature is printed with italic font. |
strike_out |
Name of column that controls if a feature is printed struck out. |
The columns "bold", "italic" and "strike_out" need to contain logical values (i.e. TRUE/FALSE)
df <- data.frame( feature = c("good", "bad"), bg_colour = c("green", "red"), txt_colour = c("grey", "blue"), bold = TRUE, italic = TRUE, strike_out = TRUE, stringsAsFactors = FALSE ) mydict <- as_dict(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.