sort-Spectra-method: Sort a Spectra object

Description Usage Arguments Examples

Description

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.

Usage

1
2
## S4 method for signature 'Spectra'
sort(x, decreasing = FALSE, na.last = NA, which.col, ...)

Arguments

x

A Spectra object

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 sort.

Examples

1
2
3
4
5
sp <- spc.example_spectra()
sp2 <- sort(sp, which.col="Offset")
sp2$Offset
sp2 <- sort(sp, which.col="CAST", decreasing=TRUE)
sp2$CAST

geoSpectral documentation built on Feb. 20, 2020, 5:08 p.m.