View source: R/geom-magic-text.R
latex_expression | R Documentation |
Helper function to convert a LaTeX string to expression.
latex_expression(
x,
sup = NULL,
sub = NULL,
space = "\\ ",
user_defined = list(),
env = parent.frame(),
mode = "formula",
output = "character",
...
)
parse_func(..., output = "character")
x |
a character vector. |
sup |
one-length character, indicates that characters after this is superscript. |
sub |
one-length character, indicates that characters after this is subscript. |
space |
if 'mode = "formula"', will replace space in x with it. |
user_defined |
user-defined command, see |
env |
environment to evaluate each expression in. |
mode |
'inline' means string is normal text with some formula, and 'formula' means all string is formula. |
output |
the type of returned object, should be expression or character. |
... |
other parameters passing to |
Hou Yun
name <- c("A_2", "B^3", "C_2", "D^{123 + x}")
name <- latex_expression(name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.