[R] gower distance calculation

Gavin Simpson gavin.simpson at ucl.ac.uk
Fri Nov 17 14:36:39 CET 2006


On Fri, 2006-11-17 at 14:50 +0200, Roy Spitz wrote:
> Hello
> 
>  
> 
> I have 2 rows in a matrix and I want to calculate the Gower Distance between
> the 2 , how can I do it?
> I searched and found nothing that can help me, and my program doesn't know
> the gdist function and I couldn't find it on the R help site.
> 
>  
> 
> Can anyone help me plz

vegdist in package vegan has Gower's distance, but all variables have to
be numeric.

If you want to use mixed data (numerics, factors, binary), see ?daisy in
package cluster.

HTH

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson                 [t] +44 (0)20 7679 0522
 ECRC & ENSIS, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list