str_mk | R Documentation |
markdown superscript and subscript
str_mk(x)
label_mk(labels, ...)
x |
character vector |
labels |
character vector |
... |
ignored |
Dongdong Kong
x <- c(
"gC m^{-2} d^{-1}",
"gC m^-2 d^-1",
"gC m_{-2} d_{-1}",
"gC m_-2 d_-1",
"gC \n mm/d"
)
str_mk(x)
## use str_mk in ggplot
library(ggplot2)
d <- data.frame(
x = 1:3, y = 1:3,
varname = c("T_min", "T_max", "T_avg")
)
ggplot(d, aes(x, y)) +
geom_point() +
geom_richtext(aes(label = varname), x = 2, y = 2) +
facet_wrap(~varname, labeller = label_mk) +
theme(
strip.text = element_markdown(face = "bold")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.