add_heatcircle: Add circles with correlation-dependent size

Description Usage Arguments Details Value See Also

Description

lotri_heatcircle() and utri_heatcircle() are used to display circles whose fill and size aesthetics depend on correlation strength in the lower/upper off-diagonal facets of ggcorrm plots.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
lotri_heatcircle(
  mapping = NULL,
  corr_method = NULL,
  rmin = 0.1,
  rmax = 0.9,
  scale_by = c("area", "radius"),
  ...
)

utri_heatcircle(
  mapping = NULL,
  corr_method = NULL,
  rmin = 0.1,
  rmax = 0.9,
  scale_by = c("area", "radius"),
  ...
)

Arguments

mapping

Set of aesthetic mappings created by aes. x and y are set automatically and must not be changed, but all other aesthetics may be manipulated. Defaults to NULL (use standard ggcorrm mapping).

corr_method

character string with the correlation method passed to cor(). Can be one of "pearson", "kendall" and "spearman". Defaults to "pearson" (or is inherited from the setting in ggcorrm()).

rmin

numeric (0 - 1). Minimum radius for the "heat circles" (as a proportion of panel width). Defaults to 0.1.

rmax

numeric (0 - 1). Maximum radius for the "heat circles" (as a proportion of panel width). Defaults to 0.9.

scale_by

character. scale_by = "area" scales the area of the circles by correlation strength, scale_by = "radius" scales by radius. Defaults to "area".

...

Additional arguments to stat_heatcircle.

Details

lotri_heatcircle() and utri_heatcircle() are wrappers around stat_heatcircle() that additionally take care of the right specification of aesthetics.

stat_heatcircle() computes the outlines of circles that are centered around the midpoint of ggcorrm facets and whose radius or area is modified in dependence of correlation strength. rmin and rmax allow to modify the range in which the radii of the circles may vary. By standard, the fill aesthetic is mapped to .corr, but this can be overridden by specifying a different mapping.

Value

A ggplot2 layer with circles displaying correlation strength.

See Also

stat_heatcircle, stat_heatmap


r-link/corrmorant documentation built on Jan. 10, 2021, 7:26 p.m.