plot_cor: Plot a heatmap

Description Usage Arguments Value See Also Examples

Description

Plot a heatmap of the given data. Usefull to use after compute_cor for instance.

Usage

1
2
3
4
plot_cor(data, type = c("full", "lower", "upper"), limits_scale = c(-1,
  1), title_legend = "Correlation", palette = c("viridis", "inferno",
  "magma", "plasma"), value = FALSE, color_value = "#ffffff",
  clustering = FALSE, text_size = 12, ...)

Arguments

data

A matrix or data frame.

type

A string to change the type of heatmap. One of "full" (default), "lower" or "upper".

limits_scale

The scale of the fill aesthetic (-1 to 1 by default).

title_legend

A string to change the title of the legend.

palette

A string indicating the color palette to use. One of "viridis" (default) "magma", "inferno" or "plasma".

value

A boolean (FALSE by default). Should the values should be visible?

color_value

A color string ("#ffffff" by default) for the label values.

clustering

A boolean (FALSE by default). Should the variables be ordered by a clustering? Use the Mclust function.

text_size

A numeric value to change the size of the labels.

...

Parameters to pass to theme.

Value

A ggplot2 object.

See Also

compute_cor

Examples

1
2
3
4
5
6
7
8
cor_results <- compute_cor(mtcars)
plot_cor(cor_results)

# change the palette and show the values
plot_cor(cor_results, palette = "inferno", value = TRUE)

# show only the lower triangle and reorder the columns by cluster
plot_cor(cor_results, type = "lower", clustering = TRUE)

thoera/corr documentation built on May 8, 2019, 11:59 p.m.