make_all_rects: Allows the creation of all rectangles on a correlation plot...

Description Usage Arguments Examples

View source: R/corrplot-rectangles.R

Description

Allows the creation of all rectangles on a correlation plot using a vector of cutpoints to divide them.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
make_all_rects(
  cutpoints,
  endpoint,
  ondiag = TRUE,
  offdiag = TRUE,
  col_ondiag = "black",
  col_offdiag = "red",
  ondiag_width = 4,
  offdiag_width = 3,
  correlation_matrix,
  ...
)

Arguments

cutpoints

A vector containing the names of the cutpoints (i.e names of variables contained in the correlation plot). The first cutpoint is the variable that will start off the first rectangle. The second cutpoint then defines the starting point of the second rectangle, and so on.

endpoint

The name of the variable contained in the correlation plot that will define the end of the last rectangle to be made.

ondiag

Defaults to TRUE. If TRUE, the function will generate the associated on-diagonal rectangles.

offdiag

Defaults to TRUE. If FALSE, the function will generate the associated off-diagonal rectangles.

col_ondiag

Defines the colour of on-diagonal rectangles.

col_offdiag

Defines the colour of off-diagonal rectangles.

ondiag_width

Defines the line width of the on-diagonal rectangles.

offdiag_width

Defines the line width of the off-diagonal rectangles.

correlation_matrix

The correlation matrix the correlation plot is based on.

...

Arguments to modify graphical parameters, etc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#Adds all rectangles associated with the cutpoints to the correlation plot of
#the Bechtoldt sample correlation matrix (provided by the psych package).
library(psych)
corrplot::corrplot(Bechtoldt)
make_all_rects(cutpoints=c("First_Names", "Vocabulary", "Suffixes"), endpoint
="Three_Higher", correlation_matrix=Bechtoldt)

#Adds all on-diagonal rectangles associated with the cutpoints.
make_all_rects(cutpoints=c("First_Names", "Vocabulary", "Suffixes"), endpoint
="Three_Higher", offdiag=FALSE, correlation_matrix=Bechtoldt)

douglaswhitaker/MVQuickGraphs documentation built on Sept. 18, 2021, 7:17 p.m.