<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4522.1800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=828571614-10012002><FONT face=Arial color=#0000ff size=2>The
Euclidean inner product <v, w> of vectors v, w is |v|*|w|*cos(angle). So
you could first normalize the vectors to length 1, then if they are columns of a
matrix A, crossprod(A) ( = A'A) gives you the matrix of
cosines.</FONT></SPAN></DIV>
<DIV><SPAN class=828571614-10012002><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=828571614-10012002><FONT face=Arial color=#0000ff size=2>Reid
Huntsinger</FONT></SPAN></DIV>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Petra Steiner
[mailto:steinep@uni-muenster.de]<BR><B>Sent:</B> Wednesday, January 09, 2002
5:14 PM<BR><B>To:</B> r-help@lists.r-project.org<BR><B>Subject:</B> [R] Distance
matrix by cosine?<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>a. is there a possibility to obtain a distance
matrix with the cosine between vectors?? hclust, hierclust, dist will not work
and seem to be hard to extend.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>b. if there is not: Is the
cosine between vectors implemented somewhere?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks for all hints and advice!</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Petra Steiner</FONT> </DIV></BODY></HTML>