Skip to contents

Generate axis labels for response or action spectra in SI units, using SI scale factors. Output can be selected as character, expression (R default devices) or LaTeX (for tikz device).

Usage

s.e.response_label(
  unit.exponent = 0,
  format = getOption("photobiology.math", default = "R.expression"),
  label.text = axis_labels(append = ifelse(axis.symbols, ",", ""))[["s.e.response"]],
  scaled = FALSE,
  normalized = FALSE,
  axis.symbols = getOption("ggspectra.axis.symbols", default = TRUE)
)

s.q.response_label(
  unit.exponent = 0,
  format = getOption("photobiology.math", default = "R.expression"),
  label.text = axis_labels(append = ifelse(axis.symbols, ",", ""))[["s.q.response"]],
  scaled = FALSE,
  normalized = FALSE,
  axis.symbols = getOption("ggspectra.axis.symbols", default = TRUE)
)

s.e.action_label(
  unit.exponent = 0,
  format = getOption("photobiology.math", default = "R.expression"),
  label.text = axis_labels(append = ifelse(axis.symbols, ",", ""))[["s.e.action"]],
  scaled = FALSE,
  normalized = FALSE,
  axis.symbols = getOption("ggspectra.axis.symbols", default = TRUE)
)

s.q.action_label(
  unit.exponent = 0,
  format = getOption("photobiology.math", default = "R.expression"),
  label.text = axis_labels(append = ifelse(axis.symbols, ",", ""))[["s.q.action"]],
  scaled = FALSE,
  normalized = FALSE,
  axis.symbols = getOption("ggspectra.axis.symbols", default = TRUE)
)

Arguments

unit.exponent

integer

format

character string, "R", "R.expression", "R.character", or "LaTeX".

label.text

character Textual portion of the labels.

scaled

logical If TRUE relative units are assumed.

normalized

logical (FALSE) or numeric Normalization wavelength in manometers (nm).

axis.symbols

logical If TRUE symbols of the quantities are added to the name. Supported only by format = "R.expression".

Value

a character string or an R expression.

Examples


s.e.response_label()
#> "Spectral energy response," ~ italic(R(E))[lambda] ~ (plain("") * 
#>     plain(J^{
#>         -1
#>     } ~ m^{
#>         -2
#>     } ~ nm^{
#>         -1
#>     }))
s.e.response_label(format = "R.expression")
#> "Spectral energy response," ~ italic(R(E))[lambda] ~ (plain("") * 
#>     plain(J^{
#>         -1
#>     } ~ m^{
#>         -2
#>     } ~ nm^{
#>         -1
#>     }))
s.e.response_label(format = "R.character")
#> [1] "Spectral energy response, R(E)(lambda) (J-1 m-2 nm-1)"
s.e.response_label(format = "LaTeX")
#> [1] "Spectral energy response, $R(E)_{\\lambda}$ ($J^{-1} m^{-2} nm^{-1})$)"
s.e.response_label(unit.exponent = 3, format = "R.character")
#> [1] "Spectral energy response, R(E)(lambda) (kJ-1 m-2 nm-1)"
s.q.response_label(format = "R.character")
#> [1] "Spectral photon response, R(Q)(lambda) (mol-1 m-2 nm-1)"
s.e.action_label(format = "R.character")
#> [1] "Spectral energy action, A(E)(lambda) (J-1 m-2 nm-1)"
s.q.action_label(format = "R.character")
#> [1] "Spectral photon action, A(Q)(lambda) (mol-1 m-2 nm-1)"
s.e.response_label(scaled = TRUE)
#> "Spectral energy response," ~ italic(R(E))[lambda] ~ plain((rel. ~ 
#>     units))
s.e.response_label(scaled = TRUE, format = "R.character")
#> [1] "Spectral energy response, R(lambda) (rel. units)"
s.e.response_label(scaled = TRUE, format = "LaTeX")
#> [1] "Spectral energy response, $R(E)_{\\lambda}$ (rel. units)"
s.e.response_label(normalized = 300)
#> "Spectral energy response," ~ italic(R(E))[lambda]/italic(R(E))[300] ~ 
#>     plain("(/1)")
s.e.response_label(normalized = 300, format = "R.character")
#> [1] "Spectral energy response, R(E)(lambda) (norm. at 300 nm)"
s.e.response_label(normalized = 300, format = "LaTeX")
#> [1] "Spectral energy response, $R(E)_{\\lambda} / R(E)_{300}$ (/1)"
s.q.response_label(scaled = TRUE)
#> "Spectral photon response," ~ italic(R(Q))[lambda] ~ plain((rel. ~ 
#>     units))
s.q.response_label(scaled = TRUE, format = "R.character")
#> [1] "Spectral photon response,  (rel. units)"
s.q.response_label(scaled = TRUE, format = "LaTeX")
#> [1] "Spectral photon response,  $R(Q)_{\\lambda}$ (rel. units)"
s.q.response_label(normalized = 300)
#> "Spectral photon response," ~ italic(R(Q))[lambda]/italic(R(Q))[300] ~ 
#>     plain("(/1)")
s.q.response_label(normalized = 300, format = "R.character")
#> [1] "Spectral photon response, R(Q)(lambda) (norm. 300 nm)"
s.q.response_label(normalized = 300, format = "LaTeX")
#> [1] "Spectral photon response, $R(Q)_{\\lambda} / R(Q)_{300}$ (/1)"