<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<DIV> </DIV>
<DIV 
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV style="FONT: 10pt tahoma">
<DIV><FONT color=#9b00d3 size=4 face=Arial>Qual a biblioteca para 
isto?</FONT></DIV></DIV>
<DIV> </DIV></DIV>
<DIV 
style="FONT-SIZE: small; FONT-FAMILY: 'Calibri'; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; TEXT-DECORATION: none; DISPLAY: inline">
<DIV dir=ltr>Olá todos, 
<DIV> </DIV>
<DIV>Gostaria de uma ajuda para plotar Principal Components Analysis (PCA) e 
clusters juntos.</DIV>
<DIV>Possuo dados ambientais de 25 locais espalhados em 5 diferentes 
ecossistemas que quando agrupados em 5 clusters, locais de ecossitemas 
diferentes se juntam no mesmo grupo. Logo, uma bagunça.<BR>Assim, quero plotar 
os 2 juntos (PCA e Clusters) de maneira que, locais pertencentes ao mesmo 
ecossistema possuam as mesmas CORES, e locais agrupados no mesmo cluster, 
possuam mesma FORMA. Por exemplo: <BR>1 local da Floresta de Araucária e 1 local 
da Floresta Decidual (logo com cores diferentes azul e verde respectivamente) 
estão no mesmo cluster (logo, representados pela mesma figura, triângulo).</DIV>
<DIV> </DIV>
<DIV>Como fazer essa combinação?</DIV>
<DIV>Abaixo segue os comandos que estou usando para fazer minhas combinação, no 
entanto. Nesse código, consigo juntar PCA e Cluster. no entanto sem diferenciar 
as cores de cada local de acordo com eu 
ecossistema.<BR><BR>#PCA<BR>mydata.pca<-rda(mydata)<BR clear=all>
<DIV>
<DIV>
<DIV>#Cluster</DIV>
<DIV>mydata.w <- hclust(dist(Sqchord.mydata), "ward")</DIV>
<DIV>plot(mydata.w, hang=-1)</DIV>
<DIV>rect.hclust(mydata.w, 5)</DIV><BR># Cut the dendrogram to yield 5 
groups</DIV>
<DIV>gr <- cutree(mydata.w, k=5)</DIV>
<DIV>grl <- levels(factor(gr))<BR><BR>
<DIV># Get the site scores, scaling 1</DIV>
<DIV>sit.sc1 <- scores(mydata.pca, display="w", scaling=3)</DIV>
<DIV> </DIV></DIV></DIV>
<DIV>
<DIV># Plot the sites with cluster symbols and colours (scaling 3)</DIV>
<DIV>p <- plot(mydata.pca,  display="wa", scaling=3, type="n", 
<BR></DIV>
<DIV>          main="Mydata PCA and 
clusters")</DIV>
<DIV>abline(v=0, lty="dotted")</DIV>
<DIV>abline(h=0, lty="dotted")</DIV>
<DIV>for (i in 1:length(grl))</DIV>
<DIV>{  points(sit.sc1[gr==i,], pch=(14+i), cex=2.5, col=i+1)}</DIV>
<DIV>text(sit.sc1, row.names(Pre_euro_veg.1.all), cex=0.7, pos=3)</DIV></DIV>
<DIV> </DIV>
<DIV>
<DIV># Add legend interactively</DIV>
<DIV>legend(locator(1), paste("Cluster", c(1:length(grl))), 
pch=14+c(1:length(grl)), </DIV>
<DIV>       col=1+c(1:length(grl)), 
pt.cex=2)<BR><BR></DIV></DIV>
<DIV>Desde já, agradeço por qualquer ajuda.<BR><BR>Jackson M. Rodrigues</DIV>
<DIV> </DIV>
<DIV dir=ltr><PRE cols="72"><FONT face="'courier new', monospace">
</FONT><BR></PRE></DIV></DIV></DIV>
<P>
<HR>
_______________________________________________<BR>R-br mailing 
list<BR>R-br@listas.c3sl.ufpr.br<BR>https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br<BR>Leia 
o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo 
reproduzível.</DIV></DIV></DIV></BODY></HTML>