Trim head and tail of a spectrum based on wavelength limits, with interpolation at range boundaries used by default. Expansion is also possible.
trim_wl(x, range, use.hinges, fill, ...)# S3 method for default
trim_wl(x, range, use.hinges, fill, ...)
# S3 method for generic_spct
trim_wl(x, range = NULL, use.hinges = TRUE, fill = NULL, ...)
# S3 method for generic_mspct
trim_wl(
x,
range = NULL,
use.hinges = TRUE,
fill = NULL,
...,
.parallel = FALSE,
.paropts = NULL
)
# S3 method for waveband
trim_wl(
x,
range = NULL,
use.hinges = TRUE,
fill = NULL,
trim = getOption("photobiology.waveband.trim", default = TRUE),
...
)
# S3 method for list
trim_wl(
x,
range = NULL,
use.hinges = TRUE,
fill = NULL,
trim = getOption("photobiology.waveband.trim", default = TRUE),
...
)
A copy of x
, usually trimmed or expanded to a different
length, either shorter or longer. Possibly with some of the original
spectral data values replaced with fill
.
an R object.
a numeric vector of length two, or any other object for which function range() will return two.
logical Flag indicating whether to insert "hinges" into the spectral data before integration so as to reduce interpolation errors at the boundaries of the wavebands.
if fill == NULL
then tails are deleted, otherwise tails
are filled with the value of fill.
ignored (possibly used by derived methods).
if TRUE, apply function in parallel, using parallel backend provided by foreach
a list of additional options passed into the foreach function when parallel computation is enabled. This is important if (for example) your code relies on external data or packages: use the .export and .packages arguments to supply them so that all cluster nodes have the correct environment set up for computing.
logical (default is TRUE which trims the wavebands at the boundary, while FALSE discards wavebands that are partly off-boundary).
trim_wl(default)
: Default for generic function
trim_wl(generic_spct)
: Trim an object of class "generic_spct" or derived.
trim_wl(generic_mspct)
: Trim an object of class "generic_mspct" or derived.
trim_wl(waveband)
: Trim an object of class "waveband".
trim_wl(list)
: Trim a list (of "waveband" objects).
Other trim functions:
clip_wl()
,
trim_spct()
,
trim_waveband()
trim_wl(sun.spct, range = c(400, 500))
trim_wl(sun.spct, range = c(NA, 500))
trim_wl(sun.spct, range = c(400, NA))
Run the code above in your browser using DataLab