Learn R Programming

photobiology (version 0.11.3)

clip_wl: Clip head and/or tail of a spectrum

Description

Clip head and tail of a spectrum based on wavelength limits, no interpolation used at range boundaries.

Usage

clip_wl(x, range, ...)

# S3 method for default clip_wl(x, range, ...)

# S3 method for generic_spct clip_wl(x, range = NULL, ...)

# S3 method for generic_mspct clip_wl(x, range = NULL, ...)

# S3 method for waveband clip_wl(x, range = NULL, ...)

# S3 method for list clip_wl(x, range = NULL, ...)

Value

a spectrum object or a collection of spectral objects of the same class as x with wavelength heads and tails clipped.

Arguments

x

an R object.

range

a numeric vector of length two, or any other object for which function range() will return range of wavelengths expressed in nanometres.

...

ignored (possibly used by derived methods).

Methods (by class)

  • clip_wl(default): Default for generic function

  • clip_wl(generic_spct): Clip an object of class "generic_spct" or derived.

  • clip_wl(generic_mspct): Clip an object of class "generic_mspct" or derived.

  • clip_wl(waveband): Clip an object of class "waveband".

  • clip_wl(list): Clip a list (of objects of class "waveband").

See Also

Other trim functions: trim_spct(), trim_waveband(), trim_wl()

Examples

Run this code
clip_wl(sun.spct, range = c(400, 500))
clip_wl(sun.spct, range = c(NA, 500))
clip_wl(sun.spct, range = c(400, NA))

Run the code above in your browser using DataLab