[R] colour coded points in biplot

Domenico Vistocco vistocco at unicas.it
Thu Dec 6 11:27:26 CET 2007


If you are using correspondence analysis you could see the plot.ca 
function in the ca library.

Petr PIKAL wrote:
> 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.
>
>



More information about the R-help mailing list