Get and set labels of a hyperSpec
object.
a hyperSpec
object
numeric or character to specify the label(s)
if the result would be a list with only one element, should the element be returned instead?
ignored
should missing labels be replaced by column names of the extra data?
the new label(s)
labels
returns a list of labels. If drop
is
TRUE
and the list contains only one element, the element is
returned instead.
labels<-
returns a hyperSpec
object.
value
may be a list or vector of labels giving the new label for
each of the entries specified by which
.
The names of the labels are the same as the colnames of the
data.frame
. The label for the wavelength axis has the name
.wavelength
.
The labels should be given in a form ready for the text-drawing functions
(see grDevices::plotmath()
), e.g. as expression
or a
character
.
labels(faux_cell)
#> $x
#> expression("x position")
#>
#> $y
#> expression("y position")
#>
#> $region
#> [1] "region"
#>
#> $spc
#> expression("intensity (arbitrary units)")
#>
#> $.wavelength
#> expression(Delta * tilde(nu)/cm^-1)
#>
labels(flu, "c") <- expression("/"("c", "mg / l"))