[R] biplot_group_colours_and_point_symbols

Indermaur Lukas Lukas.Indermaur at eawag.ch
Tue Aug 12 16:18:29 CEST 2008


thanks petr,
i try it out and get back to you in case of problems.
cheers,
lukas

________________________________

Von: Petr PIKAL [mailto:petr.pikal at precheza.cz]
Gesendet: Di 12.08.2008 13:18
An: Indermaur Lukas
Cc: R-help at stat.math.ethz.ch
Betreff: Odp: [R] biplot_group_colours_and_point_symbols



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