[R] colour coded points in biplot

From: Petr PIKAL <petr.pikal_at_precheza.cz>
Date: Thu, 6 Dec 2007 10:52:18 +0100


Dear all

I tried to make a biplot with color coded labels but I was not successful. Searching archives I found that it is probably not so simple. I found
http://tolstoy.newcastle.edu.au/R/help/05/01/10661.html

which recommends eqscplot

eqscplot(fit$score[,1], fit$score[,2], pch = 20, col=c(rep(2,10), rep(3,40)), cex=2)

http://tolstoy.newcastle.edu.au/R/help/05/01/10661.html

or I can use plot itself, but then I was not able to find how to add arrows.

The closest I get is

fit<-(princomp(USArrests, cor = TRUE))
biplot(fit , xlabs=rep("", 50))
points(fit$score[,1], fit$score[,2], pch = 20, col=c(rep(2,10), rep(3,40)), cex=2)

and use some suitable scaling before calling points.

My question is if there is some other easier approach to get color coded points in biplot?

Petr Pikal
petr.pikal_at_precheza.cz



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 06 Dec 2007 - 09:55:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 06 Dec 2007 - 11:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.