Learn R Programming

spork (version 0.3.5)

as.expression.plotmath: Coerce Plotmath to Expression

Description

Coerces plotmath to expression by parsing as text.

Usage

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

Value

expression

Arguments

x

plotmath

...

ignored arguments

See Also

Other interface: as_html.spar(), as_html.spork(), 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(), as_plotmath.greek(), as_plotmath.spar(), as_plotmath.spork(), concatenate.plotmath(), ggplot.plotmath(), goodToken(), plotmathToken()

Examples

Run this code
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

Run the code above in your browser using DataLab