Function to isolate spectral features

Share:

Description

Function isolates specified absorption features previously identified by define.features.

Usage

1
2
3
4
5
specfeat(x, FWL)

## S4 method for signature 'Specfeat'
plot(x, fnumber = 1, stylebysubset = NULL, changecol = TRUE, 
     changetype = FALSE, autolegend = TRUE, new = TRUE, ...)

Arguments

x

Object of class Speclib containing the band depth or ratio transformed reflectance spectra with additional information on feature limits calculated by define.features. For plot this must be object of class specfeat.

FWL

A vector containing one wavelength per feature to be isolated, e.g. the major absorption features. Features which include these specified wavelengths will be isolated.

fnumber

Index of feature(s) to be plotted.

stylebysubset

Name of variable to be used as grouping factor. May be selected from attributes table, groups or subgroups and must be convertible to factors.

changecol

Flag, if line colour should be varied among groups

changetype

Flag, if line styles should be varied among groups

autolegend

Flag if, legend is printed automatically.

new

Create new plot or add data to existing one.

...

Further arguments passed to plot function.

Value

An object of class Specfeat containing the isolated features.

Author(s)

Hanna Meyer and Lukas Lehnert

See Also

define.features, cut_specfeat, Specfeat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(spectral_data)

## Transform speclib
bd <- transformSpeclib(spectral_data, method = "sh", out = "bd")

## Define features automatically
features <- define.features(bd)

##Example to isolate the features around 450nm, 700nm, 1200nm and 1500nm.
featureSelection <- specfeat(features, c(450,700,1200,1500))

## Plot features
plot(featureSelection, 1:4)

## Advanced plotting example
plot(featureSelection, 1:4, stylebysubset = "season")

plot(featureSelection, 1:4, stylebysubset = "season", changecol = FALSE, 
     changetype = TRUE)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.