[Vegan-commits] r827 - in pkg/vegan: R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 19 10:43:06 CEST 2009


Author: jarioksa
Date: 2009-05-19 10:43:01 +0200 (Tue, 19 May 2009)
New Revision: 827

Modified:
   pkg/vegan/R/kendall.global.R
   pkg/vegan/inst/ChangeLog
Log:
kendall.global: could get wrong counts of ties in large data sets

Modified: pkg/vegan/R/kendall.global.R
===================================================================
--- pkg/vegan/R/kendall.global.R	2009-05-15 21:56:21 UTC (rev 826)
+++ pkg/vegan/R/kendall.global.R	2009-05-19 08:43:01 UTC (rev 827)
@@ -47,7 +47,8 @@
         p.i <- n.per.gr[i]
         if(p.i < 2) stop("There is a single variable in group ",gr.lev[i])
         ##CC# Correction factors for tied ranks (eq. 3.3)
-        t.ranks <- apply(R[,gr[[i]]], 2, function(x) summary(as.factor(x)))
+        t.ranks <- apply(R[,gr[[i]]], 2,
+                         function(x) summary(as.factor(x), maxsum=n))
         T. <- sum(unlist(lapply(t.ranks, function(x) sum((x^3)-x))))
 	
         ##CC# Compute the Sum of squares of the uncentred ranks (S) (eq. 3.1)

Modified: pkg/vegan/inst/ChangeLog
===================================================================
--- pkg/vegan/inst/ChangeLog	2009-05-15 21:56:21 UTC (rev 826)
+++ pkg/vegan/inst/ChangeLog	2009-05-19 08:43:01 UTC (rev 827)
@@ -4,6 +4,9 @@
 
 Version 1.16-19 (opened May 14, 2009)
 
+	* kendall.global: fixed a bug that caused incorrect counts of ties
+	in large data sets.
+
 	* tsallis: division by zero occurred with hill=TRUE, scale=1,
 	this bug has been fixes to give exp(x) as scales goes to 1.
 



More information about the Vegan-commits mailing list