if (interactive ()){
ispc <- sample (nrow (laser), 10)
ispc
identified <- spc.identify (plotspc (laser[ispc]))
## convert to the "real" spectra indices
ispc [identified$ispc]
identified$wl
identified$spc
## allow the labels to be plotted into the plot margin
spc.identify (plotspc (laser[ispc]), ispc = ispc, xpd = NA)
spc.identify (plotspc (paracetamol, xoffset = 1100,
wl.range = c (600 ~ 1700, 2900 ~ 3150)),
formatter = spc.label.wlonly)
## looking for minima
spc.identify (plot (-paracetamol, wl.reverse = TRUE),
point.fn = spc.point.min, adj = c (1, 0.5))
}
Run the code above in your browser using DataLab