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)
Run the code above in your browser using DataLab