Description Usage Arguments Examples
Applies the sort() method for Spectra
class to every element of a SpcList
object.
All the Spectra
objects within the SpcList
object gets sorted according to the
specified criteria.
1 2 |
x |
A |
decreasing |
Logical. If TRUE, then the rows are sorted in decreasing order. Passed on to the sort.idx() function from the base package. Default is FALSE. |
na.last |
for controlling the treatment of NAs. Passed on to the sort.idx() function from the base package. Default is NA. |
which.col |
A character, defining the name of the column to be used in the sorting |
... |
arguments to be passed to or from methods. See help of |
1 2 3 4 5 6 | sp <- spc.example_spectra()
#Create an SpcList object (one separate Spectra object for each unique STATION)
spL <- spc.makeSpcList(sp,"STATION")
#Sort all Spectra objects with respect to their rows using the CAST column
spL.s <- sort(spL,which.col="CAST",decreasing=TRUE)
lapply(spL.s, function(x) as.character(x[["CAST"]]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.