[Dplr-commits] r774 - in pkg/dplR: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 7 10:45:17 CEST 2014


Author: mvkorpel
Date: 2014-04-07 10:45:17 +0200 (Mon, 07 Apr 2014)
New Revision: 774

Modified:
   pkg/dplR/ChangeLog
   pkg/dplR/R/powt.R
Log:
Patch from Christian Zang.
Removed rescaling of transformed series in powt().


Modified: pkg/dplR/ChangeLog
===================================================================
--- pkg/dplR/ChangeLog	2014-04-07 07:49:38 UTC (rev 773)
+++ pkg/dplR/ChangeLog	2014-04-07 08:45:17 UTC (rev 774)
@@ -11,6 +11,14 @@
 - Added plot.rwl as an S3Method.
 - Added summary.rwl as an S3Method.
 
+File: powt.R
+------------
+
+- Originally, the transformed series were rescaled to their
+  original mean and variance, which can lead to negative values for
+  the (supposedly) raw tree-ring data.  This is not necessary, and
+  has been removed now.
+
 File: rwl.stats
 -------------------------
 - Added an S3 summary method for rwl objects so that summary(an rwl object)

Modified: pkg/dplR/R/powt.R
===================================================================
--- pkg/dplR/R/powt.R	2014-04-07 07:49:38 UTC (rev 773)
+++ pkg/dplR/R/powt.R	2014-04-07 08:45:17 UTC (rev 774)
@@ -34,15 +34,11 @@
     }
     transf <- function(x) {
         Xt <- x
-        sdx <- sd(x, na.rm = TRUE)
-        meanx <- mean(x, na.rm = TRUE)
         X.nna <- which(!is.na(x))
         X <- na.omit(x)
         p <- fit.lm(X)
         X2 <- X^p
-        X2sc <- scale(X2)
-        X2resc <- (X2sc * sdx) + meanx
-        Xt[X.nna] <- X2resc
+        Xt[X.nna] <- X2
         Xt
     }
     prec <- getprec(rwl)



More information about the Dplr-commits mailing list