[R] plot(pam.object) error with R-1.7.0 on Red-Hat 8.0 i686

Martin Maechler maechler at stat.math.ethz.ch
Tue Apr 29 18:39:30 CEST 2003


>>>>> "alessandro" == alessandro semeria <alessandro.semeria at cramont.it>
>>>>>     on Mon, 28 Apr 2003 18:53:11 +0200 writes:

    alessandro> I don't know if there is some fault in compiling
    alessandro> or a bug of the new R-1.7.0 version:

    > cl.pam.2 <- pam(as.dist(1-cor(mel.data)),2)
    > plot(cl.pam.2)

    alessandro> perform a right partitioning and silhouette plot
    alessandro> on the old R-1.6.2 instead "Error in
    alessandro> clusplot.default(x$diss,...... ; x is not
    alessandro> numeric" is the output on the new R-1.7.0.  Same
    alessandro> platform: RH8.0 i686.  Some suggestions?

yes.  
This is a bug in the cluster package I'm maintaining.
(I'll file a bug report myself).
One workaround is to say

    cl.pam.2 <- pam(as.dist(1-cor(mel.data)), k=2, keep.diss = TRUE)
    ##                                            ^^^^^^^^^^^^^^^^^^
    plot(cl.pam.2)

{this is a workaround and unnecessary and *not* recommended for
 the next release  of the cluster package !}


Note that the `keep.diss' is a new argument to pam() {and agnes() and others},
which is not anymore always TRUE by default -- for a good reason:

This allows quite a bit larger datasets than previously,
and also improves on speed (for memory allocation!!) in these
cases.

BUT as you found above,  I have overlooked to adapt  plot()
method for pam() results to this case.

PS: I think I was able to entirely reproduce what you did, but
the clustering (of the 31 variables) is pretty "bad":
30 variables in 1st cluster; and variable "M93.007" alone in the
2nd cluster.
If you look at   silhouette(cl.pam.2)   {which is implicitly
used in the above plot() statement} you'll realize that the
silhouette width is really not useful for this case {all widths
are 0}.


Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><



More information about the R-help mailing list