Learn R Programming

photobiology (version 0.9.16)

spread: Length of object in wavelength units

Description

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

Usage

spread(x, ...)

# S3 method for default spread(x, ...)

# S3 method for numeric spread(x, ...)

# S3 method for waveband spread(x, ...)

# S3 method for generic_spct spread(x, ...)

# S3 method for generic_mspct spread(x, ..., idx = !is.null(names(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)

  • default: Default method for generic function

  • numeric: Method for "numeric"

  • waveband: Method for "waveband"

  • generic_spct: Method for "generic_spct"

  • generic_mspct: Method for "generic_mspct" objects.

Examples

Run this code
# NOT RUN {
spread(sun.spct)

# }

Run the code above in your browser using DataLab