as.expression.plotmath: Coerce Plotmath to Expression

View source: R/expression.R

as.expression.plotmathR Documentation

Coerce Plotmath to Expression

Description

Coerces plotmath to expression by parsing as text.

Usage

## S3 method for class 'plotmath'
as.expression(x, ...)

Arguments

x

plotmath

...

ignored arguments

Value

expression

See Also

Other interface: as_html.spar(), as_html.spork(), as_latex.default(), as_latex.spar(), as_latex.spork(), as_plotmath.spar(), as_plotmath.spork(), as_previews.spork(), as_spork.character(), htmlToken(), latexToken(), plotmathToken()

Other plotmath: [.plotmath(), [[.plotmath(), as.png.plotmath(), as_plotmath.spar(), as_plotmath.spork(), as_plotmath(), concatenate.plotmath(), ggplot.plotmath(), goodToken(), plotmathToken()

Examples

x <- c(
  'V_c./F',
  'AUC_ss',
  'C_max_ss',
  'var^eta_j'
)
x <- as_spork(x)
x <- as_plotmath(x)
x
as.expression(x)[[4]]
as.expression(x[[4]])
class(as.expression(x))
lapply(as.expression(x), class)
as.expression(as_plotmath(as_spork('V_c./F')))
as.expression(as_plotmath(as_spork(character(0))))
library(magrittr)
'gravitational force (kg\\.m/s^2.)' %>%
  as_spork %>%
  as_plotmath %>%
  as.expression -> label
  label

spork documentation built on Sept. 16, 2023, 9:06 a.m.