[Dplr-commits] r922 - pkg/dplR/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 18 10:38:39 CET 2014


Author: zang
Date: 2014-12-18 10:38:38 +0100 (Thu, 18 Dec 2014)
New Revision: 922

Modified:
   pkg/dplR/R/glk.R
Log:
GLK fixed for the case of neighbouring identical measurements in both series in the same years

Modified: pkg/dplR/R/glk.R
===================================================================
--- pkg/dplR/R/glk.R	2014-12-12 18:55:16 UTC (rev 921)
+++ pkg/dplR/R/glk.R	2014-12-18 09:38:38 UTC (rev 922)
@@ -20,11 +20,11 @@
                     } else {
                         dif1 <- sign(diff(col1[not.na.both]))
                         dif2 <- sign(diff(col2[not.na.both]))
-                        G[i, k] <- sum(abs(dif1 + dif2)) / (2 * m - 2)
-                    }
-                }
-            }
-        }
-    }
+                        G[i, k] <- 1 - sum(abs(dif1 - dif2))/(2 * m - 2)
+                     }
+                  }
+              }
+          }
+      }
     G
 }



More information about the Dplr-commits mailing list