plotmat | R Documentation |
Plot matrix as heatmap
plotmat(x, text = FALSE, plot = TRUE, ...)
x |
A matrix. |
text |
Whether to print the values of the matrix as text (defaults to FALSE). |
plot |
Whether to plot the resulting ggplot object (defaults to TRUE). |
... |
Ignored. |
Invisibly returns the ggplot object for further modification.
Sercan Kahveci
# Create a matrix to plot
mymat <- matrix(rnorm(100), nrow=10)
mymat <- mymat + t(mymat)
mymat[cbind(sample(c(1:10)), sample(c(1:10)))] <- NA
colnames(mymat) <- rownames(mymat) <- sample(letters[1:10])
plotmat(mymat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.