| plt.2dcm | R Documentation |
This function creates a ggplot visualization from a 2D correlation matrix,
such as those produced by cm.sr or cm.nsr. The function attempts
to extract numeric wavelengths from the column names. If the extraction fails,
sequential indices are used.
plt.2dcm(
data,
mapping = NULL,
...,
show.stat = TRUE,
environment = parent.frame()
)
data |
A numeric 2D matrix of correlation coefficients. |
mapping |
Optional ggplot2 aesthetic mapping. |
... |
Additional arguments passed to |
show.stat |
Logical. If |
environment |
The environment in which to evaluate the plot. Defaults to |
It replaces the former ggplot.cm().
The 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.
## Not run:
library(visa)
data(NSpec.DF)
x <- NSpec.DF$N # nitrogen
S <- NSpec.DF$spectra[, seq(1, ncol(NSpec.DF$spectra), 10)] # resampled to 10 nm steps
cm2d <- cm.sr(S, x, cm.plot = FALSE)
p2d <- plt.2dcm(cm2d)
print(p2d)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.