Re: [R] pam() seems to ignore cluster number

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Tue, 24 May 2011 08:50:17 +0200

>>>>> Dario Strbenac <D.Strbenac_at_garvan.org.au> >>>>> on Wed, 18 May 2011 12:00:11 +1000 writes:

> I am using PAM with k = 10 clusters, but I only get one cluster
> ID for all my observations. I couldn't find any discussion about
> this in the help file, or mailing lists. Is there a reasonable
> explanation for this result ?

> cIDs <- pam(all, 10, cluster.only = TRUE, do.swap = FALSE)

    >> table(cIDs)

> cIDs
> 0
> 16671

> The matrix of observations can be found at :
> http://129.94.136.7/file_dump/dario/all.obj

For the mailing list archives:

Dario's data contained so many NA's that some of the computed dissimalirities "had to be" NA as well.
Had he used

    pam(all, 10)
    pam(all, 10, do.swap = FALSE)

he would have got the error message

   "No clustering performed, NAs in the computed dissimilarity matrix."

But because of 'cluster.only=TRUE'
*and* because of a lapsus of the 'cluster' maintainer (me), pam() returned without the error message in this case.

The next release of R (or of 'cluster') will give the error message also in the case of 'cluster.only=TRUE' .

Martin Maechler, ETH Zurich

> I'm using R version 2.13.0 (2011-04-13) on Platform:
> x86_64-unknown-linux-gnu (64-bit) and have cluster_1.13.3.

> --------------------------------------
> Dario Strbenac
> Research Assistant
> Cancer Epigenetics
> Garvan Institute of Medical Research
> Darlinghurst NSW 2010
> Australia



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. Received on Tue 24 May 2011 - 07:14:46 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 24 May 2011 - 07:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive