expr2latex_: [!.] Translate 'plotmath' expressions to LaTeX and remove...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/expr2latex_.R

Description

expr2latex translates a "R graphics annotation" expression to the corresponding LaTeX one.
expr2latex_ additionally removes leading and tailing double quotes (").

Usage

1

Arguments

expr

an R object of class expression or language, typically as from quote(...).

Value

A character string with the LaTeX expression corresponding to "R graphics annotation" expression expr.

Author(s)

Vilmantas Gegzna

See Also

expr2latex - translate 'plotmath' expressions to LaTeX.
label_expr2text remove expresions from labels of ggplot2, hyperSpec and plotly objects.

Other spPlot utilities: label_expr2text()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(spPlot)
library(simsalapar)
library(hyperSpec)

expr2latex_(quote(N[sim]))


labels(chondro)$.wavelength
  ## expression(Delta * tilde(nu)/cm^-1)

labels(chondro)$.wavelength  %>% expr2latex
  ## [1] "Delta * tilde(nu)/cm^-1"

labels(chondro)$.wavelength  %>% expr2latex_
  ## [1] "Delta * tilde(nu)/cm^-1"



labels(chondro)$spc
  ## expression("I / a.u.")

labels(chondro)$spc  %>% expr2latex
## [1] "\"I / a.u.\""

labels(chondro)$spc  %>% expr2latex_
## [1] "I / a.u."

GegznaV/spPlot documentation built on April 29, 2020, 11:06 p.m.