Skip to contents

Bridges luxR data into the pavo ecosystem so pavo's colour-space and visual-modelling tools (vismodel(), coldist(), colspace(), plotting) can be applied to luxR-derived spectra. The division of labour: luxR handles the water (depth propagation, inherent optical properties, the in-water light field); pavo handles the colour space.

Usage

as_rspec(x, ...)

# S3 method for class 'lux_spectrum'
as_rspec(x, name = NULL, ...)

# S3 method for class 'list'
as_rspec(x, ...)

Arguments

x

A lux_spectrum, or a (named) list of them — for example the output of from_trios. List elements are interpolated onto the first spectrum's wavelength grid before merging.

...

Passed to pavo::as.rspec() (e.g. lim, interp).

name

Single-spectrum method only: the column name to give the spectrum in the rspec. Defaults to the spectrum's meta$label, then meta$source, then "spec".

Value

A pavo rspec data frame: a wl column plus one column per spectrum.

Details

Delegates to pavo::as.rspec(), which validates the input and, by default, interpolates onto a 1 nm grid, so the result is a genuine rspec object. pavo is an optional (Suggests) dependency.

See also

as_lux_spectrum for the reverse conversion; pavo::as.rspec, pavo::vismodel

Examples

if (FALSE) { # \dontrun{
  # A bundled solar spectrum as an rspec, ready for the pavo toolkit:
  r <- as_rspec(from_solar("clear_noon"))

  # Several spectra at once (e.g. TriOS radiance scans):
  r2 <- as_rspec(from_trios(system.file("extdata/trios.dat", package = "luxR")))
} # }