Learn R Programming

photobiology (version 0.9.4)

spread.generic_mspct: Length of object in wavelength units

Description

A function that returns the spread (max(x) - min(x)) for R objects.

Usage

## S3 method for class 'generic_mspct':
spread(x, ..., idx = !is.null(names(x)))

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

spread(x, ...)

## S3 method for class 'default':
spread(x, ...)

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

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

Arguments

x
an R object
...
not used in current version
idx
logical whether to add a column with the names of the elements of spct

Value

  • A numeric value equal to max(x) - min(x). In the case of spectral objects wavelength difference in nm. For any other R object, according to available definitions of min and max.

Methods (by class)

  • generic_mspct: Method for "generic_mspct" objects.
  • generic_spct: Method for "generic_spct" objects.
  • default: Default method for generic function
  • numeric: Default method for generic function
  • waveband: Wavelength spread in nm.

Examples

Run this code
spread(sun.spct)

Run the code above in your browser using DataLab