[R] Object "silhouette.default" not found... there.

Wolski wolski at molgen.mpg.de
Tue May 25 18:56:38 CEST 2004


Hallo!

Thanks too James Holtman, Douglas Grove, Uwe Ligges, Martin Maechler,  for helpfull answers
to my questions.

Sincerely
Eryk

*********** REPLY SEPARATOR  ***********

On 5/25/2004 at 6:39 PM Martin Maechler wrote:

>>>>>> "Eryk" == Eryk Wolski <wolski at molgen.mpg.de>
>>>>>>     on Tue, 25 May 2004 17:38:10 +0200 writes:
>
>    Eryk> Hi!
>    >> library(cluster)
>    Eryk> In this lib a function called silhoutte.default is defined
>    Eryk> than on the R prompt it type
>    >> silhouette.default
>    Eryk> Error: Object "silhouette.default" not found 
>    Eryk> R1.9.0
>    Eryk> The same error are at R1.8.1
>    Eryk> And I knew that a function silhoutte.default are present.
>
>Hi Eryk,
>
>please do learn about namespaces;  many good R packages (incl.
>all standard and recommended packages) nowadays make use of
>namespaces, and we expect even more in the future.
>
>One big advantage of 'namespacing a package' is that
>you can make sure that your functions call your other functions
>even if they have the same name as someone's functions in
>another package.  Another big "pro" is that you can use as many
>``package-internal'' objects {"helper-functions" in my useR talk}
>as you want: They won't be visible to the user and not clutter
>the global namespace.
>One side effect of namespaces: We usually do not export (S3)
>methods such as silhouette.default() :
>
>A user should call silhouette(...) and the method dispatching
>chooses the corresponding method.
>
>Now, to see "hidden" objects, you can 
>
>1) use  getAnywhere()	        { getAnywhere("silhouette.default") }
>2) use  <namespace>:::<object>  { cluster:::silhouette.default }
>
>and for S3 methods,
>
>3) getS3method("<generic>", "<class>")
>
>   i.e., in this case getS3method("silhouette", "default")
>
>----------
>
>BUT:  You won't see the source code of silhouette.default !
>
>Instead:
>
>  1) Learn how to get and unpack the package source and then
>     see    cluster/R/silhouette.R
>
>  2) if "1)" is too difficult,
>     open the filename you get from
>	   system.file("../cluster/R/cluster")
>     in a text editor -- preferably an R-aware one ...
>     which gives you a large file with all R source from the
>     cluster package.   Now look for what you want.
>
>Regards,
>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			<><



Dipl. bio-chem. Eryk Witold Wolski    @    MPI-Moleculare Genetic   
Ihnestrasse 63-73 14195 Berlin       'v'    
tel: 0049-30-83875219               /   \    
mail: wolski at molgen.mpg.de        ---W-W----    http://www.molgen.mpg.de/~wolski




More information about the R-help mailing list