Thanks for the hints! They seem to help me.
Axel
Héctor Villalobos schrieb:
Perhaps this may help you.
Regards
data(iris3)
ir <- rbind(iris3[ , , 1], iris3[ , , 2], iris3[ , , 3])
ir.pca <- princomp(ir)
biplot(ir.pca)
# Rehacer Biplot
# Calcular Factor para re-escalar scores y eigenvectores
lambda <- ir.pca$sdev[1:2] * sqrt(ir.pca$n.obs)
scores <- t( t(ir.pca$scores[ , c(1, 2)]) / lambda
)
variables <- t( t(ir.pca$loadings[ , c(1, 2)]) * lambda )
x11()
plot(scores, type="p", xlim=c(-0.22, 0.24), ylim=c(-0.2, 0.2),
pch=c(rep(16, 50), rep(21, 50), rep(14, 50)),
col=c(rep("red", 50), rep("blue", 50), rep("green", 50)))
abline(v=0, h=0, lty=3)
par(new=TRUE)
plot(variables, type="n", xaxt="n", yaxt="n", xlim=c(-22, 24),
ylim=c(-20, 20))
arrows(0, 0, variables[ , 1], variables[ , 2], len=0.1, col="red")
text(2*variables, rownames(variables), col="red", xpd=TRUE)
axis(3); axis(4)
On 25 Feb 2009 at 9:52, Axel Strauß wrote:
Date sent: Wed, 25 Feb 2009 09:52:54 +0100
From: Axel Strauß <a.stra...@tu-bs.de>
To: R-help@r-project.org
Subject: Re: [R] biplot.princomp - changing score
labels
> Prof Brian Ripley schrieb:
> > On Tue, 24 Feb 2009, Axel Strauß wrote:
> >
> >> OK, the one thing I figured out:
> >> Is should be like:
> >> biplot(test.pca, cex=c(2,1), col=c("red","green")...
> >> to change size, colours etc separately. But I still don't know how
> >> change lables of observations to symbols properly.
> >
> > That's not part of the design of the function, so just make a copy
> > and edit to meet your fancies.
> >
> > The designer of biplot.princomp.
> >
> The idea behind my question was actually not a "styling one" but to
> provide additional information in the graph. My observations have
> different species richness and I wanted to adopt symbol size to the
> number of species to show the change of species richness along the
> PCs. Anyway, thanks for the comment - and for designing
> biplot.princomp.
>
> Axel
>
--
Héctor Villalobos <hvill...@ipn.mx>
CICIMAR - IPN
A.P. 592. Col. Centro
La Paz, Baja California Sur, MÉXICO. 23000
Tels. (+52 612) 122 53 44; 123 46 58; 123 47 34 ext. 82425
Fax. (+52 612) 122 53 22
--
Gravity is a habit that is hard to shake off.
Terry Pratchett
______________________________________________
R-help@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.