hyperSpec
objectR/DEPRECATED-wl_sort.R
DEPRECATED-orderwl.Rd
These hyperSpec functions are deprecated and not maintained any more. You should not use these. Currently they are present due to back-compatibility reasons and will be removed in the next release of the package. Please, use the suggested alternative functions instead.
_____________
Rearranges the hyperSpec
object so that the wavelength vector is in
increasing (or decreasing) order.
The wavelength vector is sorted and the columns of the spectra matrix are rearranged accordingly.
orderwl(x, na.last = TRUE, decreasing = FALSE)
x | The |
---|---|
na.last, decreasing | Handed to |
A hyperSpec
object.
C. Beleites
## Example 1: different drawing order in plotspc spc <- new("hyperSpec", spc = matrix(rnorm(5) + 1:5, ncol = 5)) spc <- cbind(spc, spc + .5) plotspc(spc)spc_sorted <- orderwl(spc)#> Warning: Function 'orderwl' is deprecated. #> Use function 'wl_sort' instead.## Example 2 spc <- new("hyperSpec", spc = matrix(rnorm(5) * 2 + 1:5, ncol = 5)) spc <- cbind(spc, spc) plot(seq_len(nwl(spc)), spc[[]], type = "b")spc[[]]#> 1 2 3 4 5 1 2 3 #> [1,] 1.283441 -0.5075538 2.064181 4.539015 1.31807 1.283441 -0.5075538 2.064181 #> 4 5 #> [1,] 4.539015 1.31807spc_sorted <- orderwl(spc)#> Warning: Function 'orderwl' is deprecated. #> Use function 'wl_sort' instead.spc_sorted[[]]#> 1 1 2 2 3 3 4 #> [1,] 1.283441 1.283441 -0.5075538 -0.5075538 2.064181 2.064181 4.539015 #> 4 5 5 #> [1,] 4.539015 1.31807 1.31807