Skip to contents

A method that returns the expanse (\(max(x) - min(x)\)) for R objects. In particular the wavelength [\(nm\)] expanse of the wavelength range of objects of classes waveband or of class generic_spct or derived (or the expanse of values in a numeric vector).

Usage

spread(x, ...)

wl_expanse(x, ...)

expanse(x, ...)

# Default S3 method
expanse(x, ...)

# S3 method for class 'numeric'
expanse(x, ...)

# S3 method for class 'waveband'
expanse(x, ...)

# S3 method for class 'generic_spct'
expanse(x, ...)

# S3 method for class 'generic_mspct'
expanse(x, ..., idx = "spct.idx")

Arguments

x

an R object

...

not used in current version

idx

character Name of the column with the names of the members of the collection of spectra.

Value

A numeric value equal to max(x) - min(x). In the case of spectral objects wavelength difference [\(nm\)]. For any other R object, according to available specialised methods of min and max.

Methods (by class)

  • expanse(default): Default method for generic function

  • expanse(numeric): Method for "numeric"

  • expanse(waveband): Method for "waveband"

  • expanse(generic_spct): Method for "generic_spct"

  • expanse(generic_mspct): Method for "generic_mspct" objects.

Examples

expanse(10:20)
#> [1] 10
expanse(sun.spct)
#> [1] 520
wl_expanse(sun.spct)
#> [1] 520

expanse(sun.spct)
#> [1] 520