ggcorrelogram {Correlplot}R Documentation

Create a correlogram as a ggplot object.

Description

Function ggcorrelogram creates a correlogram of a correlation matrix using ggplot graphics.

Usage

ggcorrelogram(R, labs = colnames(R), ifun = "cos", cex = 1, main = "", ntrials = 50,
              xlim = c(-1.2, 1.2), ylim = c(-1.2, 1.2), hjust = 1, vjust = 2, size = 2,
	      main.size = 8)

Arguments

R

a correlation matrix

labs

a vector of labels for the variables

ifun

the interpretation function ("cos" or "lincos")

cex

character expansion factor for the variable labels

main

a title for the correlogram

ntrials

number of starting points for the optimization routine

xlim

limits for the x axis (e.g. c(-1.2,1.2))

ylim

limits for the y axis (e.g. c(-1.2,1.2))

hjust

horizontal adjustment of variable labels (by default 1 for all variables)

vjust

vertical adjustment of variable labels (by default 2 for all variables)

size

font size for the labels of the variables

main.size

font size of the main title of the correlogram

Details

ggcorrelogram makes a correlogram on the basis of a set of angles. All angles are given w.r.t the positive x-axis. Variables are represented by unit vectors emanating from the origin.

Value

A ggplot object. Field theta of the output contains the angles for the variables.

Author(s)

Jan Graffelman (jan.graffelman@upc.edu)

References

Trosset, M.W. (2005) Visualizing correlation. Journal of Computational and Graphical Statistics 14(1), pp. 1–19

See Also

correlogram,fit_angles,nlminb

Examples

 set.seed(123)
 X <- matrix(rnorm(90),ncol=3)
 R <- cor(X)
 angles <- ggcorrelogram(R)

[Package Correlplot version 1.1.0 Index]