initialize {hyperSpec} | R Documentation |
Creating a hyperSpec Object
Description
Like other S4 objects, a hyperSpec object can be created by new
. The
hyperSpec object is then initialize
d using the given parameters.
Usage
## S4 method for signature 'hyperSpec'
initialize(.Object, spc = NULL, data = NULL, wavelength = NULL, labels = NULL)
Arguments
.Object |
the new |
spc |
the spectra matrix.
|
data |
However, it will usually be more convenient if the spectra are given in
|
wavelength |
The wavelengths corresponding to the columns of
|
labels |
A If |
Details
If option gc
is TRUE
, the initialization will have frequent
calls to gc ()
which can help to avoid swapping or running out of
memory.
Author(s)
C.Beleites
See Also
new
for more information on creating and
initializing S4 objects.
plotmath
on expressions for math annotations as
for slot label
.
Examples
new ("hyperSpec")
spc <- matrix (rnorm (12), ncol = 4)
new ("hyperSpec", spc = spc)
new ("hyperSpec", data = data.frame (x = letters[1:3]),
spc = spc)
colnames (spc) <- 600:603
new ("hyperSpec", spc = spc) # wavelength taken from colnames (spc)
# given wavelengths precede over colnames of spc
new ("hyperSpec", spc = spc, wavelength = 700:703)
# specifying labels
h <- new ("hyperSpec", spc = spc, data = data.frame (pos = 1 : 3),
label = list (spc = "I / a.u.",
.wavelength = expression (tilde (nu) / cm^-1),
pos = expression ("/" (x, mu*m)))
)
plot (h)
plotc (h, spc ~ pos)