[Analogue-commits] r108 - in pkg: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 6 19:54:54 CEST 2009


Author: gsimpson
Date: 2009-04-06 19:54:54 +0200 (Mon, 06 Apr 2009)
New Revision: 108

Modified:
   pkg/R/distance.R
   pkg/inst/ChangeLog
Log:
fix bug in distance method kendall; was using min not pmin on input vectors x and y

Modified: pkg/R/distance.R
===================================================================
--- pkg/R/distance.R	2009-04-03 19:33:15 UTC (rev 107)
+++ pkg/R/distance.R	2009-04-06 17:54:54 UTC (rev 108)
@@ -83,7 +83,7 @@
       }
     kendall <- function(x, y, maxi)
       {
-        sum(maxi - min(x, y))
+        sum(maxi - pmin(x, y))
       }
     gower <- function(x, y, maxi, mini)
       {

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2009-04-03 19:33:15 UTC (rev 107)
+++ pkg/inst/ChangeLog	2009-04-06 17:54:54 UTC (rev 108)
@@ -5,6 +5,9 @@
 	* optima, tolerance: new methods to coerce objects of these classes
 	to data frames.
 
+	* distance: method = "kendall" was incorrectly computing the min of
+	the x and y components in the dissimilarity.
+
 Version 0.6-6 (Released to CRAN: Wed 25th Feb 2009)
 
 	* optima, tolerance: New print methods for both functions. Returned 



More information about the Analogue-commits mailing list