Learn R Programming

photobiology (version 0.11.4)

split_bands: List-of-wavebands constructor

Description

Build a list of unweighted "waveband" objects that can be used as input when calculating irradiances.

Usage

split_bands(
  x,
  list.names = NULL,
  short.names = is.null(list.names),
  length.out = NULL
)

Value

an un-named list of waveband objects

Arguments

x

a numeric vector of wavelengths to split at (nm), or a range of wavelengths or a generic_spct or a waveband.

list.names

character vector with names for the component wavebands in the returned list (in order of increasing wavelength)

short.names

logical indicating whether to use short or long names for wavebands

length.out

numeric giving the number of regions to split the range into (ignored if w.length is not numeric).

See Also

Other waveband constructors: waveband()

Examples

Run this code
split_bands(c(400,500,600))
split_bands(list(c(400,500),c(550,650)))
split_bands(list(A=c(400,500),B=c(550,650)))
split_bands(c(400,500,600), short.names=FALSE)
split_bands(c(400,500,600), list.names=c("a","b"))
split_bands(c(400,700), length.out=6)
split_bands(400:700, length.out=3)
split_bands(sun.spct, length.out=10)
split_bands(waveband(c(400,700)), length.out=5)

Run the code above in your browser using DataLab