orderwl: Sorting the Wavelengths of a hyperSpec Object Rearranges the...

Description Usage Arguments Value Author(s) See Also Examples

Description

The wavelength vector is sorted and the columns of the spectra matrix are rearranged accordingly.

Usage

1
orderwl(x, na.last = TRUE, decreasing = FALSE)

Arguments

x

The hyperSpec object.

na.last,decreasing

Handed to order.

Value

A hyperSpec object.

Author(s)

C. Beleites

See Also

order

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Example 1: different drawing order in plotspc
spc <- new ("hyperSpec", spc = matrix (rnorm (5) + 1:5, ncol = 5))
spc <- cbind (spc, spc+.5)

plot (spc, "spc")
text (wl (spc), spc [[]], as.character (1:10))
spc <- orderwl (spc)
plot (spc, "spc")
text (wl (spc), spc [[]], as.character (1:10))

## 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[[]]

spc <- orderwl (spc)
lines (seq_len(nwl(spc)), spc[[]], type = "l", col = "red")
spc[[]]

Example output

Loading required package: lattice
Loading required package: grid
Loading required package: ggplot2
Package hyperSpec, version 0.99-20180627

To get started, try
   vignette ("hyperspec")
   package?hyperSpec 
   vignette (package = "hyperSpec")

If you use this package please cite it appropriately.
   citation("hyperSpec")
will give you the correct reference.

The project homepage is http://hyperspec.r-forge.r-project.org


            1         2        3        4        5        1         2        3
[1,] -1.18142 0.5299727 3.423864 5.341631 9.178525 -1.18142 0.5299727 3.423864
            4        5
[1,] 5.341631 9.178525
            1        1         2         2        3        3        4        4
[1,] -1.18142 -1.18142 0.5299727 0.5299727 3.423864 3.423864 5.341631 5.341631
            5        5
[1,] 9.178525 9.178525

hyperSpec documentation built on May 2, 2019, 5:45 p.m.