Learn R Programming

hyperSpec (version 0.98-20140523)

seq.hyperSpec: Sequence generation along spectra or wavelengths This function generates sequences along the spectra (rows) or wavelengths of hyperSpec objects.

Description

Note that wl2i generates sequences of indices along the wavelength axis.

Usage

## S3 method for class 'hyperSpec':
seq(x, from = 1, to = nrow(x), ...,
    index = FALSE, short = "seq", user = NULL, date = NULL)

Arguments

x
the hyperSpec object
from,to
arguments handed to seq.int
...
arguments for seq, namely by, length.out
index
should a vector with indices be returned rather than a hyperSpec object?
short,user,date
handed to logentry.

Value

  • a numeric or hyperSpec object, depending on index.

code

length

Details

seq had to be implemented as S3 method as the generic has only ...

See Also

wl2i to construct sequences of wavelength indices.

seq

Examples

Run this code
seq (flu, index = TRUE)
seq_along (flu)
seq (flu, length.out = 3, index = TRUE) # return value is numeric, not integer!
seq (flu, by = 2, index = TRUE) 		    # return value is numeric, not integer!

plot (flu, col = "darkgray")
plot (seq (flu, by = 2), add = TRUE, col= "red")
plot (seq (flu, length.out = 2), add = TRUE, col= "blue")

Run the code above in your browser using DataLab