cor.plot(r,numbers=FALSE,colors=TRUE,n=51,main=NULL,zlim=c(-1,1),show.legend=TRUE,
labels=NULL,n.legend=10,keep.par=TRUE,...)
The difference between mat.plot with a regular image plot is that the primary diagonal goes from the top left to the lower right. zlim defines how to treat the range of possible values. -1 to 1 and the color choice is more reasonable. Setting it as c(0,1) will lead to negative correlations treated as zero. This is advantageous when showing general factor structures, because it makes the 0 white.
The default shows a legend for the color coding on the right hand side of the figure.
Inspired, in part, by a paper by S. Dray (2008) on the number of components problem.
Modified following suggestions by David Condon and Josh Wilt to use a more meaningful color choice ranging from dark red (-1) through white (0) to dark blue (1). Further modified to include the numerical value of the correlation. (Inspired by the corrplot package).
fa
, mat.sort
cor.plot(Thurstone,main="9 cognitive variables from Thurstone") #just blue implies positive manifold
cor.plot(Thurstone, zlim=c(0,1),main="9 cognitive variables from Thurstone")
cor.plot(mat.sort(Thurstone),TRUE,zlim=c(0,1),
main="9 cognitive variables from Thurstone (sorted by factor loading) ")
simp <- sim.circ(24)
cor.plot(cor(simp),main="24 variables in a circumplex")
Run the code above in your browser using DataLab