aggspec | R Documentation |
Combines spectra (by taking the average, for example) according to an index or a vector of identities.
aggspec(rspecdata, by = NULL, FUN = mean, trim = TRUE)
rspecdata |
(required) a data frame, possibly of class |
by |
(required) either a single value specifying the range of spectra
within the data frame to be combined (for example, |
FUN |
the function to be applied to the groups of spectra. (defaults to
|
trim |
logical. if |
A data frame of class rspec
containing the spectra after applying
the aggregating function.
Chad Eliason cme16@zips.uakron.edu
Montgomerie R (2006) Analyzing colors. In: Hill G, McGraw K (eds) Bird coloration. Harvard University Press, Cambridge, pp 90-147.
data(teal)
# Average every two spectra
teal.sset1 <- aggspec(teal, by = 2)
plot(teal.sset1)
# Create factor and average spectra by levels 'a' and 'b'
ind <- rep(c("a", "b"), times = 6)
teal.sset2 <- aggspec(teal, by = ind)
plot(teal.sset2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.