setIdFactor | R Documentation |
Function to set, rename or unset by reference the "idfactor" attribute of an
existing object of class generic_spct
or an object of a class derived
from generic_spct
.
setIdFactor(x, idfactor)
id_factor(x) <- value
x |
a generic_spct object. |
idfactor , value |
character The name of a factor identifying multiple spectra stored longitudinally. |
If the attribute idfactor
is already set, and a variable with
name equal to the value passed as argument to idfactor
does not
exist in x
, the currently set variable is renamed and the attribute
value updated. If a variable named as the argument passed to
idfactor
exists in x
, it will be set as id by storing this
name in the attribute. If the value passed as argument to idfactor
is NULL
the attribute will be unset. If the attribute is not already
set and there is no member variable in x
with a name matching the
argument passed to idfactor
, an error is triggered.
x
This function alters x itself by reference and in addition returns x invisibly. If x is not a generic_spct or an object of a class derived from generic_spct, x is not modified.
Other idfactor attribute functions:
getIdFactor()
my.spct <- sun_evening.spct
# inspecting
id_factor(sun.spct) # no idfactor set
id_factor(my.spct)
colnames(my.spct)
# renaming
id_factor(my.spct) <- "time"
getIdFactor(my.spct)
colnames(my.spct)
# removing
setIdFactor(my.spct, NULL)
getIdFactor(my.spct)
colnames(my.spct)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.