| ggplot.cm | R Documentation |
**Deprecated:** This function is deprecated and will be removed in a future release.
Please use plt.2dcm for 2D correlation matrices or the appropriate new functions for 3D plots.
## S3 method for class 'cm'
ggplot(
data,
mapping = NULL,
...,
show.stat = TRUE,
environment = parent.frame()
)
data |
A numeric 2D matrix of correlation coefficients. (For 3D arrays, a warning is issued.) |
mapping |
Optional ggplot2 aesthetic mapping. |
... |
Additional arguments passed to |
show.stat |
Logical. If |
environment |
The environment in which to evaluate the plot. Defaults to |
This function creates a ggplot visualization from a 2D correlation matrix. It attempts to extract numeric wavelengths from the column names of the input matrix.
This function extracts numeric wavelengths from the column names of data. If these
cannot be determined, sequential indices are used instead.
A ggplot object visualizing the correlation matrix. For 3D arrays, returns NULL.
## Not run:
library(visa)
data(NSpec.DF)
x <- NSpec.DF$N # nitrogen
# resampled to 10 nm steps
S <- NSpec.DF$spectra[, seq(1, ncol(NSpec.DF$spectra), 10)]
cm2d <- cm.sr(S, x, cm.plot = FALSE)
p2d <- ggplot.cm(cm2d)
print(p2d)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.