Learn R Programming

photobiology (version 0.9.6)

trim_waveband: Trim (or expand) head and/or tail

Description

Trimming of waveband boundaries can be required needed when the spectral data does not cover the whole waveband.

Usage

trim_waveband(w.band, range = NULL, low.limit = 0, high.limit = Inf,
  trim = getOption("photobiology.waveband.trim", default = TRUE),
  use.hinges = TRUE)

Arguments

w.band
an object of class "waveband" or a list of such objects
range
a numeric vector of length two, or any other object for which function range() will return a numeric vector of two wavelengths (nm)
low.limit
shortest wavelength to be kept (defaults to 0 nm)
high.limit
longest wavelength to be kept (defaults to Inf nm)
trim
logical (default is TRUE which trims the wavebands at the boundary, while FALSE discards wavebands that are partly off-boundary).
use.hinges
logical, if TRUE (the default) hinges are inserted when trimming.

Value

  • a waveband object or a list of waveband objects trimmed or filtered depending on whether a single waveband object or a list of waveband objects was supplied as argument to formal parameter w.band.

See Also

Other trim functions: clip_wl, trim_spct, trim_tails, trim_wl

Examples

Run this code
VIS <- waveband(c(380, 760)) # nanometres

trim_waveband(VIS, c(400,700))
trim_waveband(VIS, low.limit = 400)
trim_waveband(VIS, high.limit = 700)

Run the code above in your browser using DataLab