# example run only if 'pavo' is available
if (requireNamespace("pavo", quietly = TRUE)) {
library(pavo)
data(sicalis, package = "pavo")
sicalis.mspct <- rspec2mspct(sicalis)
class(sicalis.mspct)
data(teal, package = "pavo")
teal.spct <- rspec2spct(teal)
class(teal.spct)
levels(teal.spct[["spct.idx"]])
angles <- seq(from = 15, to = 75, by = 5) # from teal's documentation
teal.spct[["angle"]] <- angles[as.numeric(teal.spct[["spct.idx"]])]
teal.spct
}
Run the code above in your browser using DataLab