ggtally {Correlplot} | R Documentation |
Create a correlation tally stick on a biplot vector
Description
Function ggtally
puts a series of dots along a biplot vector of a correlation matrix,
so marking the change in correlation along the vector with specified values.
Usage
ggtally(G, p1, adj = 0, values = seq(-1, 1, by = 0.2), dotsize = 0.1, dotcolour = "black")
Arguments
G |
A matrix (or vector) of biplot markers |
p1 |
A ggplot2 object with a biplot |
adj |
A scalar adjustment for the correlations |
values |
Values of the correlations to be marked off by dots |
dotsize |
Size of the dot |
dotcolour |
Colour of the dot |
Details
Any set of values for the correlation to be marked off can be used, though a standard scale with 0.2 increments is recommmended.
Value
A ggplot2 object with the updated biplot
Author(s)
Jan Graffelman (jan.graffelman@upc.edu)
References
Graffelman, J. and De Leeuw, J. (2023) On the visualisation of the correlation matrix. Available online. doi:10.48550/arXiv.2211.13150
See Also
Examples
library(calibrate)
data(goblets)
R <- cor(goblets)
out.sd <- eigen(R)
V <- out.sd$vectors[,1:2]
Dl <- diag(out.sd$values[1:2])
Gp <- crossprod(t(V),sqrt(Dl))
pca.df <- data.frame(Gp)
pca.df$strings <- colnames(R)
colnames(pca.df) <- c("PA1","PA2","strings")
p1 <- ggbplot(pca.df,pca.df,main="PCA correlation biplot",xlab="",ylab="",rowarrow=TRUE,
rowcolor="blue",rowch="",colch="")
p1 <- ggtally(Gp,p1,values=seq(-0.2,0.6,by=0.2),dotsize=0.1)
[Package Correlplot version 1.1.0 Index]