wavelength: wavelength vector of a colorSpec object

View source: R/colorSpec.R

wavelengthR Documentation

wavelength vector of a colorSpec object

Description

Retrieve or set the wavelengths of a colorSpec object. Retrieve the number of wavelengths, and whether the wavelength sequence is regular.

Usage

## S3 method for class 'colorSpec'
wavelength(x)

## S3 replacement method for class 'colorSpec'
wavelength(x) <- value

## S3 method for class 'colorSpec'
numWavelengths(x)

## S3 method for class 'colorSpec'
is.regular(x)
step.wl(x)

Arguments

x

a colorSpec R object

value

a numeric vector with length equal to the number of wavelengths in x. The wavelengths must be increasing. The unit must be nanometers.

Details

If the organization of x is 'df.col', then x is a data.frame and the wavelength vector is stored in the first column of x.
Otherwise, the wavelength vector is stored as attr(x,'wavelength').

Value

wavelength() returns a numeric vector with the wavelengths of the spectra, in nanometers.

numWavelengths(x) is equal to length(wavelength(x)) but much more efficient.

is.regular() returns TRUE or FALSE, depending on whether the step between consecutive wavelengths is a constant. A truncation error of 1.e-6 nm is tolerated here. For example, the X-Rite ColorMunki spectrometer in hi-res mode has a step of 3.33333nm, and it is considered regular.

step.wl() returns the mean step in nm, whether the wavelengths are regular or not.

See Also

colorSpec


colorSpec documentation built on May 29, 2024, 6 a.m.