wl()
returns the wavelength axis, wl<-
sets it.
wl(x) wl(x, label = NULL, digits = 6) <- value
x | a |
---|---|
label | The label for the new wavelength axis. See initialize for details. |
digits | handed to |
value | either a numeric containing the new wavelength vector, or a
list with |
a numeric vector
hyperSpec
object
The wavelength axis of a hyperSpec
object can be retrieved and
replaced with wl
and wl<-
, respectively.
When the wavelength axis is replaced, the colnames of x@data$spc
are
replaced by the rounded new wavelengths. digits
specifies the how
many significant digits should be used.
There are two ways to set the label of the new wavelength axis, see the examples. If no label is given, a warning will be issued.
wl<-
always sets the complete wavelength axis, without
changing the columns of the spectra matrix. If you rather want to cut the
spectral range, use [
, for
interpolation along the spectral axis see
spc_loess()
and for spectral binning
spc_bin()
.
cutting the spectral range: [
interpolation along the spectral axis: spc_loess()
spectral binning: spc_bin()
C. Beleites
wl(laser)#> [1] 404.5828 404.6181 404.6534 404.6887 404.7240 404.7592 404.7945 404.8298 #> [9] 404.8651 404.9004 404.9357 404.9710 405.0063 405.0416 405.0768 405.1121 #> [17] 405.1474 405.1827 405.2180 405.2532 405.2885 405.3238 405.3591 405.3944 #> [25] 405.4296 405.4649 405.5002 405.5355 405.5707 405.6060 405.6413 405.6765 #> [33] 405.7118 405.7471 405.7823 405.8176wl(faux_cell) <- list( wl = 1e7 / (1e7 / 785 - wl(faux_cell)), label = expression(lambda / nm) ) plot(faux_cell[1])