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