knitr::opts_chunk$set( message = FALSE, collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
You can install ggmatrix
from Github with:
# install.packages("devtools") devtools::install_github("houyunhuang/ggmatrix")
library(ggmatrix) ggmat(list(m1 = mtcars)) + geom_triangle(aes(fill = m1)) m1 <- matrix(rnorm(400, mean = 9), nrow = 20) m2 <- matrix(rnorm(400, mean = -4), nrow = 20) ggmat(list(m1 = m1, m2 = m2)) + geom_triangle(aes(fill.upper = m1, fill.lower = m2)) + scale_fill_upper_gradientn(colours = c("red", "white", "blue")) + scale_fill_lower_gradientn(colours = c("#E9A3C9", "#F7F7F7", "#A1D76A")) ggmat(list(m1 = mtcars), cluster.type = "all") + geom_point(aes(size = m1)) ggmat(list(m1 = mtcars), cluster.type = "all", tree.type = "all") + geom_tile(aes(fill = m1)) + theme_matrix()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.