quickcor: Plot Correlation Matrix Quickly

Description Usage Arguments Author(s) See Also Examples

View source: R/quickcor.R

Description

quickcor is convenient wrapper for creating a number of different types of correlation matrix plots because of adding some extra settings by default.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
quickcor(
  x,
  y = NULL,
  mapping = NULL,
  grid.colour = "grey50",
  grid.size = 0.25,
  circular = FALSE,
  open = 90,
  inner = 1,
  outer = 0.3,
  fixed.xy = TRUE,
  axis.x.position = "auto",
  axis.y.position = "auto",
  axis.label.drop = TRUE,
  legend.position = "auto",
  ...
)

## S3 method for class 'quickcor'
print(x, ...)

## S3 method for class 'quickcor'
print(x, ...)

is_quickcor(x)

Arguments

x, y

matrix, data frame or quickcor object in print().

mapping

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

grid.colour

colour of grid lines.

grid.size

size of grid lines.

circular

logical, if TRUE will draw in polar coordinates.

open

angle of opening (in degree).

inner, outer

the ratio of inner circle and outer margin.

fixed.xy

if TRUE (default), the coordinates will with fixed aspect ratio.

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.

legend.position

position of legend.

...

extra params for fortify_cor.

Author(s)

Houyun Huang, Lei Zhou, Jian Chen, Taiyun Wei

See Also

fortify_cor.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require(ggplot2, quietly = TRUE)

# Initialize the plot
quickcor(mtcars)

# layer of tile
quickcor(mtcars) + geom_colour()

# layer of circle and trim the lower triangle
quickcor(mtcars, type = "upper") + geom_circle2()

# layer of ellipse and not show diagonal
quickcor(mtcars, type = "lower", show.diag = FALSE) + geom_ellipse2()

# layer of square and reorder correlation matrix by cluster
quickcor(mtcars, cluster = TRUE) + geom_square()

# layer of confidence box
quickcor(mtcars, cor.test = TRUE) + geom_confbox()

# different layer of upper/lower triangle
quickcor(mtcars, cor.test = TRUE) +
  geom_square(data = get_data(type = "lower", show.diag = FALSE)) +
  geom_mark(data = get_data(type = "upper", show.diag = FALSE)) +
  geom_abline(slope = -1, intercept = 12)

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