photobiology (version 0.9.30)

wl_midpoint: Midpoint

Description

A function that returns the wavelength (or value) at the center of the of the wavelength range of a waveband or spectrum object (or numeric vector).

Usage

wl_midpoint(x, ...)

midpoint(x, ...)

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

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

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

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

# S3 method for generic_mspct midpoint(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)) / 2. In the case of spectral objects a wavelength 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: Default method for generic function

  • waveband: Wavelength at center of a "waveband".

  • generic_spct: Method for "generic_spct".

  • generic_mspct: Method for "generic_mspct" objects.

See Also

Other wavelength summaries: wl_min(), wl_range(), wl_stepsize()

Other wavelength summaries: wl_min(), wl_range(), wl_stepsize()

Other wavelength summaries: wl_min(), wl_range(), wl_stepsize()

Examples

Run this code
# NOT RUN {
midpoint(10:20)
midpoint(sun.spct)
wl_midpoint(sun.spct)

midpoint(sun.spct)

# }

Run the code above in your browser using DataCamp Workspace