powered by
Sort a Spectra object with respect to its rows with respect to values of one given column (specified by which.col). Sorting with respect to multiple columns is not implemented yet.
Spectra
# S4 method for Spectra sort(x, decreasing = FALSE, na.last = NA, which.col, ...)
A Spectra object
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.
for controlling the treatment of NAs. Passed on to the sort.idx() function from the base package. Default is NA.
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 sort.
sort
# NOT RUN { sp <- spc.example_spectra() sp2 <- sort(sp, which.col="Offset") sp2$Offset sp2 <- sort(sp, which.col="CAST", decreasing=TRUE) sp2$CAST # }
Run the code above in your browser using DataLab