Description Details Value Methods Author(s) See Also Examples
Either retrieves the wavelengths from a Spectra*
object, or creates a Spectra*
object from a "data.frame"
object by setting some of its columns as the wavelengths.
The "ids<-"
method for SpectraDataFrame
objects allows to use a formula interface to use a column in its data
slot as the object IDs (see the last example provided in the Examples section).
The ids
methods return a vector if as.vector
is TRUE, a data.frame
otherwise. The "ids<-"
method return a SpectraDataFrame
object (or a Spectra
object if the column in the data slot that has been used to initiate the IDs was the only attribute).
ids(obj, ..., as.vector = TRUE)
ids(obj) <- value
obj | A Spectra object |
|
... | Ignored | |
as.vector | Logical, returns the IDs as a character vector rather than a 1-column data.frame . |
|
value | Either a formula or a vector of new IDs (see the Details section). | |
Pierre Roudier pierre.roudier@gmail.com
spectra
, Spectra-class
, SpectraDataFrame-class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Loading example data
data(australia)
spectra(australia) <- sr_no ~ ... ~ 350:2500
# Retrieving ids
ids(australia)
# Setting ids using a vector of values
ids(australia) <- seq_len(nrow(australia))
ids(australia)
# Setting ids using an attribute
australia$new_id <- seq_len(nrow(australia)) + 1000
ids(australia) <- ~ new_id
ids(australia)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.