View source: R/format_string.R
format_string | R Documentation |
Formats differently words in a set of text strings for plotting.
format_string(
s,
i = NULL,
b = NULL,
spt = "_",
sep = " ",
pattern = NULL,
add_terms = NULL
)
s |
string of text. |
i |
vector indicating the position of words in strings to show in italics. |
b |
vector indicating the position of words in strings to show in bold-face. |
spt |
character indicating the separator between words. |
sep |
character indicating the output separator. |
pattern |
regex pattern to select words to be omitted in formatting. |
add_terms |
vector with words to be omitted from formatting. |
At the moment, the maximum length os strings admitted is 10 words. Several terms are excluded by default from formatting: "sp", "sp.", "spp", "spp.", "unclassified", "unidentified", "others".
x <- c("Fusarium_oxysporum_P1304", "Alternaria_sp._P1555", "Fusarium_oxysporum_f.sp._melonis")
format_string(x, i = 1:4, pattern = "P[0-9]", add_terms = "f.sp.")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.