Find wavelength values corresponding to a target y value in any spectrum. The name of the column of the spectral data to be used to match the target needs to be passed as argument unless the spectrum contains a single numerical variable in addition to "w.length".
find_wls(x, target = NULL, col.name.x = NULL, col.name = NULL,
.fun = `
an R object
numeric value indicating the spectral quantity value for which wavelengths are to be searched and interpolated if need. The character strings "half.maximum" and "half.range" are also accepted as arguments.
character The name of the column in which to the
independent variable is stored. Defaults to "w.length" for objects of
class "generic_spct"
or derived.
character The name of the column in which to search for the target value.
function A binary comparison function or operator.
logical Indicating whether the nearest wavelength value
in x
should be returned or a value calculated by linear
interpolation between wavelength values stradling the target.
logical indicating whether NA
values should be stripped
before searching for the target.
A spectrum object of the same class as x
with fewer rows,
possibly even no rows. If FALSE
is passed to interpolate
a
subset of x
is returned, otherwise a new object of the same class
containing interpolated wavelenths for the target
value is
returned.