data(flea)
flea_std <- apply(flea[,1:6], 2, function(x) (x-mean(x))/sd(x))
prj <- basis_random(ncol(flea[,1:6]), 2)
flea_prj <- as.data.frame(as.matrix(flea_std) %*% prj)
par(pty = "s", mar = rep(0.1, 4))
plot(flea_prj$V1, flea_prj$V2,
xlim = c(-3, 3), ylim = c(-3, 3),
xlab="P1", ylab="P2")
draw_tour_axes(prj, colnames(flea)[1:6], limits=3)
plot(flea_prj$V1, flea_prj$V2,
xlim = c(-3, 3), ylim = c(-3, 3),
xlab="P1", ylab="P2")
draw_tour_axes(prj, colnames(flea)[1:6], limits=3, position="bottomleft")
Run the code above in your browser using DataLab