gitsvnid: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/Rtreemix@28790 bc3139a867e503109ffcced21a209358
Herve Pages authored on 16/11/2007 21:25:161  1 
new file mode 100644 
...  ... 
@@ 0,0 +1,61 @@ 
1 
+\name{distances} 

2 
+ 

3 
+\alias{L1.dist} 

4 
+\alias{euclidian.dist} 

5 
+\alias{cosin.dist} 

6 
+\alias{rank.cor.dist} 

7 
+ 

8 
+\title{Different distances between two given vectors} 

9 
+\description{ 

10 
+ These functions are used for calculating different distances between 

11 
+ two given vectors. Thus, \code{L1.dist} calculates the L1 distance, 

12 
+ \code{cosin.dist} calculates the cosine distance, \code{euclidian.dist} 

13 
+ computes the Euclidian distance, and \code{rank.cor.dist} computes 

14 
+ the rank correlation distance. The vectors have to have same length. 

15 
+ When using \code{rank.cor.dist} the vectors have to have length larger 

16 
+ than 4. 

17 
+} 

18 
+\usage{ 

19 
+L1.dist(p, q) 

20 
+cosin.dist(p, q) 

21 
+euclidian.dist(x, y) 

22 
+rank.cor.dist(x, y) 

23 
+} 

24 
+ 

25 
+\arguments{ 

26 
+ \item{p}{ A \code{numeric} vector specifying the first component for 

27 
+ the distance calculation. It has to have the same length as \code{q}.} 

28 
+ \item{q}{ A \code{numeric} vector specifying the second component for 

29 
+ the distance calculation. } 

30 
+ \item{x}{ Same as \code{p}. } 

31 
+ \item{y}{ Same as \code{q}.} 

32 
+ 

33 
+} 

34 
+ 

35 
+\value{ 

36 
+ The functions return the distance between the two given vectors. 

37 
+} 

38 
+ 

39 
+\author{Jasmina Bogojeska} 

40 
+ 

41 
+\seealso{\code{\link{kullback.leibler}}, \code{\link{L2.norm}}, \code{\link{stability.sim}}} 

42 
+\examples{ 

43 
+## Define two numeric vectors with equal lengths (> 4). 

44 
+x < c(1, 2, 3, 4, 5) 

45 
+y < c(5, 6, 7, 8, 9) 

46 
+ 

47 
+## Calculate the L1 distance between the vectors x and y 

48 
+L1.dist(x, y) 

49 
+ 

50 
+## Calculate the Euclidian distance between the vectors x and y 

51 
+euclidian.dist(x, y) 

52 
+ 

53 
+## Calculate the cosine distance between the vectors x and y 

54 
+cosin.dist(x, y) 

55 
+ 

56 
+## Calculate the rankcorrelation distance between the vectors x and y 

57 
+rank.cor.dist(x, y) 

58 
+ 

59 
+} 

60 
+ 

61 
+\keyword{misc} 