Learn R Programming

hsdar (version 0.5.1)

cut_specfeat: Cut absorption features

Description

Function cuts absorption features to a user-specified range.

Usage

cut_specfeat(x, ..., fnumber, limits)

Arguments

x
An object of class "Specfeat" containing isolated features determined by specfeat.
fnumber
A vector of the positions of the features in x to be cut.
limits
A vector containing the start and end wavelength for each fnumber. The corresponding feature will be cut to this specified range.
...
Further arguments passed to generic functions. Currently ignored.

Value

An object of class Specfeat containing the cut features.

See Also

define.features, specfeat, Specfeat

Examples

Run this code
data(spectral_data)

##Example to cut the features around 450nm and 700nm to a specific range
## Transform speclib
bd <- transformSpeclib(subset(spectral_data, season == "summer"),
                       method = "sh", out = "bd")

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

## Convert speclib to specfeat giving center wavelength of features
featureSelection <- specfeat(features, c(450,700,1200,1500))

## Cut 1st and 2nd feature to [310 nm, 560 nm] and [589 nm, 800 nm]
featuresCut <- cut_specfeat(x = featureSelection, fnumber = c(1,2), 
                            limits = c(c(310, 560), c(589, 800)))

## Plot result (1st and 2nd feature)
plot(featuresCut, fnumber = 1:2)

Run the code above in your browser using DataLab