[R] R help with princomp and pam clustering

joris meys jorismeys at gmail.com
Thu Nov 26 11:29:59 CET 2009


On Thu, Nov 26, 2009 at 1:04 AM, Tyler82 <procaccianti.claudio at gmail.com> wrote:
>
> Hi all!
> I am working with R package cluster and I have a little problem:
> let's say I have two datasets...first one ("A") is divided into 4 clusters
> by means of Pam algorythm.
> Let's say I want to project the second database ("B") onto the Comp.1 X
> Comp.2 graph, and see where its elements are placed.
> The two datasets are made of different dim (54x19 and 28x19). I tried to
> extract the $loadings of the A clustering but I can't seem to figure out how
> to use them with B :(

Prin <- princomp(A)
predict(Prin,B)

in the assumption that the variable names in both dataframes are equal.

> Using princomp I menaged to extract the $scores and plot the graph. Wouldn't
> using princomp on the B dataset generate different PC?

Indeed, it would.

> Thank you all!
> Bye!!
>
> Claudio
> --
> View this message in context: http://old.nabble.com/R-help-with-princomp-and-pam-clustering-tp26522485p26522485.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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