[R] Odp: biplot_group_colours_and_point_symbols

Petr PIKAL petr.pikal at precheza.cz
Tue Aug 12 13:18:24 CEST 2008


Hi

r-help-bounces at r-project.org napsal dne 29.07.2008 17:28:15:

> hi,
> i am seeking for a solution to create a biplot that shows: 
> a) data points instead of labels and that
> b) shows two different groups (field: site with two factor levels: 
forest/
> corridor) in different colours
> 
> i tried to include "pch=19" to show points instead of labels in the 
syntax 
> below but failed.
> 
> biplot(model, main="", iter=0.1,  cex=c(0.3,1.2), col=c(1,2))

I also tried to do such thing and finally I found a way in plotting biplot 
without points and then use a usr coordinates and add coloured points.

> fit<-princomp(iris[,1:4], cor=T)
> biplot(fit, xlabs=rep("", nrow(iris)))
> rrr<-apply(fit$scores[,1:2],2, range)
> par(usr=as.vector(rrr))
> points(fit$scores[,1:2], col=rainbow(4)[(as.numeric(iris[,5]))], pch=20)

It is probably faked a little bit but there as a method to evaluate a 
clustering in biplot it was quite OK.

Regards
Petr


> 
> i appreciate any hint.
> 
> best regards,
> lukas
> 
> 
> 
> °°° 
> Lukas Indermaur, PhD student 
> eawag / Swiss Federal Institute of Aquatic Science and Technology 
> ECO - Department of Aquatic Ecology
> Überlandstrasse 133
> CH-8600 Dübendorf
> Switzerland
> 
> Phone: +41 (0) 71 220 38 25
> Fax    : +41 (0) 44 823 53 15 
> Email: lukas.indermaur at eawag.ch
> www.lukasindermaur.ch <http://www.lukasindermaur.ch/> 
> 
> 
> 
> 
> ______________________________________________
> 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