ggheat: ggheat

Description Usage Arguments Details See Also Examples

View source: R/ggplots.R

Description

Function to plot a heat map using ggplot.

Usage

1
2
ggheat(cors = NULL, data = NULL, limits = c(-1, 1),
  gradn = rev(heat.colors(10)), gradc = c("white", "steelblue"))

Arguments

cors

matrix (or matrix-like object) of correlations

data

data frame of data (in progress)

limits

range of color scale in legend; see discrete_scale

gradn

vector of n colors to use, from low to high; see details

gradc

vector of length two, low color and high color; see details

gradc takes a low color and a high color, respectively, and generates a continuous scale between those colors; see scale_fill_gradient

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.

See Also

cor, ggheat2, icorr

Examples

1
2
3
4
5
6
library('ggplot2')
tmp <- 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'))

raredd/plotr documentation built on Nov. 19, 2018, 11:02 a.m.