scale,hyperSpec-method {hyperSpec} | R Documentation |
Center and scale hyperSpec object
Description
link[base]{scale}
s the spectra matrix. scale (x, scale = FALSE)
centers the data.
Usage
## S4 method for signature 'hyperSpec'
scale(x, center = TRUE, scale = TRUE)
Arguments
x |
the |
center |
if |
scale |
if |
Details
Package scale
provides a fast alternative for base::scale
Value
the centered & scaled hyperSpec
object
Author(s)
C. Beleites
See Also
package scale.
Examples
## mean center & variance scale
tmp <- scale (chondro)
plot (tmp, "spcmeansd")
plot (sample (tmp, 5), add = TRUE, col = 2)
## mean center only
tmp <- scale (chondro, scale = FALSE)
plot (tmp, "spcmeansd")
plot (sample (tmp, 5), add = TRUE, col = 2)
## custom center
tmp <- sweep (chondro, 1, mean, `/`)
plot (tmp, "spcmeansd")
tmp <- scale (tmp, center = quantile (tmp, .05), scale = FALSE)
[Package hyperSpec version 0.100.2 Index]