correlation.matrix: Produce a blue-scale heatmap of the correlation matrix for a...

Description Usage Arguments Value Examples

View source: R/correlation.matrix.R

Description

Produce a blue-scale heatmap of the correlation matrix for a given data.frame using ggplot2.

Usage

1
2
3
4
correlation.matrix(df,
									 method = "spearman",
									 scale = TRUE,
									 colors = NULL)

Arguments

df

Data frame whose columns will define the correlation matrix.

method

What type of correlation to use? Defaults to Spearman rank order correlation.

scale

Should we z-score correlations before plotting them?

colors

What color scheme should we use?

Value

Returns a ggplot object that can be easily saved or visualized.

Examples

1
2
3
4
5
6
7
library('ggplots')

df <- data.frame(x = c(1, 2, 3, 4, 5), y = c(2, 3, 4, 4, 5), z = c(5, 3, 4, 1, 1))

p <- correlation.matrix(df)

p

johnmyleswhite/ggplots documentation built on May 19, 2019, 5:17 p.m.