ggcor: Create a correlation plot

Description Usage Arguments Value Author(s) Examples

View source: R/ggcor.R

Description

This function is the equivalent of ggplot in ggplot2. It takes care of setting up the position of axis and legend for the plot based on the plot type.

Usage

1
2
3
4
5
6
7
ggcor(
  data,
  mapping = NULL,
  axis.x.position = "auto",
  axis.y.position = "auto",
  axis.label.drop = TRUE
)

Arguments

data

cor_tbl object.

mapping

NULL (default) or a list of aesthetic mappings to use for plot.

axis.x.position, axis.y.position

the position of the axis. 'auto' (default) is set according to the plot type, 'bottom' or 'top' for x axes, 'left' or 'right' for y axes.

axis.label.drop

logical value (default is TRUE). When type of plot is 'upper' or 'lower' and 'show.diag' is FALSE, do you need to remove the blank coordinate label.

Value

an object of class gg onto which layers, scales, etc. can be added.

Author(s)

Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei

Examples

1
2
3
4
df <- fortify_cor(mtcars)
ggcor(df)
df01 <- fortify_cor(mtcars, type = "lower", show.diag = FALSE)
ggcor(df01, axis.label.drop = TRUE)

houyunhuang/ggcor documentation built on July 22, 2020, 8:31 p.m.