This function generates sequences along the spectra (rows) or wavelengths of
hyperSpec
objects.
# S3 method for hyperSpec seq(x, from = 1, to = nrow(x), ..., index = FALSE)
x | the |
---|---|
from, to | arguments handed to |
... | arguments for |
index | should a vector with indices be returned rather than a hyperSpec object? |
a numeric or hyperSpec object, depending on index
.
Note that wl2i()
generates sequences of indices along the wavelength axis.
seq()
had to be implemented as S3 method as the generic has only ...
arguments (on which no dispatch with differing types is possible).
base::seq_along()
is not generic, but returns a sequence of the length
of the object. As hyperSpec
provides a Method length()
, it can be used.
The result is a sequence of indices for the spectra.
wl2i()
to construct sequences of wavelength indices.
C. Beleites
#> [1] 1 2 3 4 5 6seq_along(flu)#> [1] 1 2 3 4 5 6#> [1] 1.0 3.5 6.0#> [1] 1 3 5### needs to be an S3 function as S4 ... dispatch has to have the same signature for all parameters