Skip to contents

Return a copy of an R object with its class set to a given type of spectrum.

Usage

as.response_spct(x, ...)

# Default S3 method
as.response_spct(x, time.unit = "second", ...)

# S3 method for class 'waveband'
as.response_spct(
  x,
  time.unit = "second",
  w.length = NULL,
  fill = 0,
  unit.in = getOption("photobiology.radiation.unit", default = "energy"),
  unit.out = unit.in,
  strict.range = getOption("photobiology.strict.range", default = FALSE),
  na.rm = FALSE,
  ...
)

Arguments

x

an R object.

...

other arguments passed to "set" functions.

time.unit

character string indicating the time unit used for spectral irradiance or exposure ("second", "day" or "exposure") or an object of class duration as defined in package lubridate.

w.length

numeric vector of wavelengths (nm).

fill

value to use as response for wavelengths outside the waveband range.

unit.in, unit.out

the type of unit we assume as reference: "energy" or "photon" based for the waveband definition and the implicit matching response plotted.

strict.range

logical Flag indicating whether off-range values result in an error instead of a warning.

na.rm

logical.

Value

A copy of x converted into a response_spct object.

Methods (by class)

  • as.response_spct(default):

  • as.response_spct(waveband):