data(goblets)
R <- cor(goblets)
results <- eigen(R)
V <- results$vectors
Dl <- diag(results$values)
#
# Calculate correlation biplot coordinates
#
G <- crossprod(t(V[,1:2]),sqrt(Dl[1:2,1:2]))
#
# Make the biplot
#
bplot(G,G,rowch=NA,colch=NA,collab=colnames(R),
xl=c(-1.1,1.1),yl=c(-1.1,1.1))
#
# Create a correlation tally stick for variable X1
#
tally(G[1,])
Run the code above in your browser using DataLab