[R] Package: cluster -- plot.partition() change title: main=""

Martin Maechler maechler at stat.math.ethz.ch
Thu Feb 6 10:36:02 CET 2003

>>>>> "BernPf" == Pfaff, Bernhard <Bernhard.Pfaff at drkw.com>
>>>>>     on Wed, 5 Feb 2003 15:55:42 +0100 writes:

    BernPf> I am using the cluster package and by the generation
    BernPf> of plot.partition I ran into the problem that an
    BernPf> alternative title overlaps the default title.

    >> plot.partition(clara.14,which.plot=2,stand=TRUE, 
    >> 		     main="Silhouette plot of 14 clusters")

{ using an explicit method call which is ``discouraged''.
  Simply using  plot(.......) gives the same result. }

    BernPf> The manual states that all optional arguments for
    BernPf> clusplot.default may also be supplied to
    BernPf> plot.partition(). Altering the title in clusplot()
    BernPf> works.  Question: What am I doing wrong and what
    BernPf> would be the correct way to insert the graphic title
    BernPf> "Silhouette plot of 14 clusters" alone?

For the moment, you must change the code, for an *installed*
package, this is the file  <RHOME>/library/cluster/R/cluster
Change the two lines {1433 and 1448 in the above file} with text
    plot(silhouette(x), nmax.lab, max.strlen)
    plot(silhouette(x), nmax.lab, max.strlen, ...)

This will work perfectly in your case,
but can give extraneous warnings in other situations.
The next version of cluster will have a better solution,
an explicit `main' argument.

    BernPf> I am using R 1.61 on Windows NT and the latest
    BernPf> available cluster package from CRAN.

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