corrgram() function is used to plot correlograms.
The corrgram function produces a graphical display of a correlation matrix, called a correlogram. The cells of the matrix can be shaded or colored to show the correlation value. corrgram( x, type = NULL, order = FALSE, labels, panel = panel.
The corrgram function produces a graphical display of a correlation matrix, called a correlogram. The cells of the matrix can be shaded or colored to show the correlation value.
Usage
corrgram(
x,
type = NULL,
order = FALSE,
labels,
panel = panel.shade,
lower.panel = panel,
upper.panel = panel,
diag.panel = NULL,
text.panel = textPanel,
label.pos = c(0.5, 0.5),
label.srt = 0,
cex.labels = NULL,
font.labels = 1,
row1attop = TRUE,
dir = “”,
gap = 0,
abs = FALSE,
** col.regions = colorRampPalette(c(“red”, “salmon”, “white”, “royalblue”, “navy”)),**
cor.method = “pearson”,
outer.labels = NULL,
…
)
Arguments
x
A tall data frame with one observation per row, or a correlation matrix.
type
Use ‘data’ or ‘cor’/‘corr’ to explicitly specify that ‘x’ is data or a correlation matrix. Rarely needed.
order
Should variables be re-ordered? Use TRUE or “PCA” for PCA-based re-ordering. If the ‘seriation’ package is loaded, this can also be set to “OLO” for optimal leaf ordering, “GW”, and “HC”.
labels
Labels to use (instead of data frame variable names) for diagonal panels. If ‘order’ option is used, this vector of labels will be also be appropriately reordered by the function.
panel
Function used to plot the contents of each panel.
lower.panel, upper.panel
Separate panel functions used below/above the diagonal.
diag.panel, text.panel
Panel function used on the diagonal.
label.pos
Horizontal and vertical placement of label in diagonal panels.
label.srt
String rotation for diagonal labels.
cex.labels, font.labels
Graphics parameter for diagonal panels.
row1attop
TRUE for diagonal like " \ ", FALSE for diagonal like " / ".
dir
Use dir="left"
instead of ‘row1attop’.
gap
Distance between panels.
abs
Use absolute value of correlations for clustering? Default FALSE.
col.regions
A function returning a vector of colors.
cor.method
Correlation method to use in panel functions. Default is ‘pearson’. Alternatives: ‘spearman’, ‘kendall’.
outer.labels
A list of the form ‘list(bottom,left,top,right)’. If ‘bottom=TRUE’ (for example), variable labels are added along the bottom outside edge.
For more control, use ‘bottom=list(labels,cex,srt,adj)’, where ‘labels’ is a vector of variable labels, ‘cex’ affects the size, ‘srt’ affects the rotation, and ‘adj’ affects the adjustment of the labels. Defaults: ‘labels’ uses column names; cex=1’; ‘srt=90’ (bottom/top), ‘srt=0’ (left/right); ‘adj=1’ (bottom/left), ‘adj=0’ (top/right).
…
Additional arguments passed to plotting methods.