spc.identify {hyperSpec}R Documentation

Identifying Spectra and Spectral Data Points

Description

This function allows to identify the spectrum and the wavelength of a point in a plot produced by plotspc.

Usage

spc.identify(x, y = NULL, wavelengths = NULL, ispc = NULL, ...)

Arguments

x either the abscissa coordinates or the list returned by plotspc
y the ordinate values. Giving y will override any values from x$y.
wavelengths the wavelengths for the data points. Giving wavelengths will override any values from x$wavelengths.
ispc if a selection of spectra was plotted, their indices can be given in ispc. In this case ispc [i] is returned rather than i.
... passed to identify

Details

The function uses identify to identify the points clicked at with the left button and converts them into a more convenient format.

Value

a data.frame with columns

i spectra indices of the identified points, i.e. the rows of the hyperSpec object that was plotted.
If ispc is given, ispc [i] is returned rather than i.
wavelengths the wavelengths of the identified points

Author(s)

C. Beleites

See Also

identify, plotspc

Examples

## Not run: 
ispc <- sample (nrow (laser), 10)
ispc

identified <- spc.identify (plotspc (laser[ispc]))
## convert to the "real" spectra indices
ispc [identified$i]
identified$wavelength

spc.identify (plotspc (laser[ispc]), ispc = ispc)
## End(Not run)

[Package hyperSpec version 0.95 Index]