ggheat | R Documentation |
Function to plot a heat map using ggplot
.
ggheat(
cors = NULL,
data = NULL,
limits = c(-1, 1),
gradn = rev(heat.colors(10)),
gradc = c("white", "steelblue")
)
cors |
matrix (or matrix-like object) of correlations |
data |
data frame of data (in progress) |
limits |
range of color scale in legend; see
|
gradn |
vector of |
gradc |
vector of length two, low color and high color; see details
|
gradn
takes a vector of n
colors: either a list of names, a
list of hexadecimal values, an existing color palette (i.e.,
heat.colors
, rainbow
, etc); see also
palette
, colors
, the RColorBrewer
package, etc.
cor
, ggheat2
, icorr
library('ggplot2')
tmp <- rawr::rescaler(matrix(1:25, 5))
diag(tmp) <- 1
colnames(tmp) <- rownames(tmp) <- LETTERS[1:5]
ggheat(cors = tmp, limits = c(0, 1))
ggheat(cors = tmp, gradn = NULL, gradc = c('white', 'red'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.