[R] 2 questions about cluster analysis

Martin Maechler maechler at stat.math.ethz.ch
Mon Sep 2 15:16:22 CEST 2002


>>>>> "Fredy" == Fredy Mejía <fmejia at mac.com>
>>>>>     on Tue, 27 Aug 2002 09:58:46 -0600 writes:

Hola Fredy,

    Fredy> Hello everyone!  I have two questions regarding
    Fredy> cluster analysis with the package 'cluster' :

    Fredy> 1.  I have a dissimilarity matrix in csv format, 
you mean it's in a *file* in csv format ?
--> look at the help pages ?read.csv and maybe ?scan on how to
read the file.  
Maybe you'll want to apply as.matrix(.) on the result

    Fredy> and I would like to use it to generate a dendogram using
    Fredy>'hclust'.  How do I make that matrix compatible with
    Fredy> the function?  I think it has to be similar to the
    Fredy> objects generated by the 'dist' function.  Any ideas?

Yes (but this has nothing to do with the cluster package,
     both  hclust() and dist() are in package mva).
Have you looked at  help(dist) ?

Given the following question {and also in general}, I'd
recommend to use
   daisy()  instead of dist()   --> help(daisy)
and
   agnes()  instead of hclust()

    Fredy> 2.  Does anybody have a code for calculating a
    Fredy> similarity matrix using the Nei-Li index.  
Can you tell us what it is?

    Fredy> My data has either presence (1) or absence (0) for several
    Fredy> attributes in 73 individuals (specifically, I'm
    Fredy> trying to construct a dendogram with RFLP data)

This (binary or categorical variables; and missing values) is a
reason for using daisy() instead of dist() !

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			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list