if (requireNamespace("fda.usc", quietly = TRUE)) {
# from spectra to fdata
sun.fdata <- spct2fdata(sun.spct)
str(sun.fdata)
polyester.fdata <- spct2fdata(polyester.spct)
str(polyester.fdata)
# from fdata to spectra
fdata2spct(sun.fdata)
fdata2spct(sun.fdata, drop.idx = TRUE)
fdata2spct(polyester.fdata, drop.idx = TRUE)
}
Run the code above in your browser using DataLab