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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 14 09:27:06 CET 2014


Author: mvkorpel
Date: 2014-01-14 09:27:05 +0100 (Tue, 14 Jan 2014)
New Revision: 723

Modified:
   pkg/dplR/DESCRIPTION
   pkg/dplR/R/detrend.R
   pkg/dplR/R/detrend.series.R
Log:
Reverted changes to default of constrain.modnegexp argument made in r721.
Reasoning: match.arg(foo) checks that the user gives a valid value for
foo (must expand to or match one of the options) and returns the first
character string from the default of foo if the user gives no
value. So, what looks like a multi-string default becomes one string.


Modified: pkg/dplR/DESCRIPTION
===================================================================
--- pkg/dplR/DESCRIPTION	2014-01-14 01:19:07 UTC (rev 722)
+++ pkg/dplR/DESCRIPTION	2014-01-14 08:27:05 UTC (rev 723)
@@ -3,7 +3,7 @@
 Type: Package
 Title: Dendrochronology Program Library in R
 Version: 1.5.8
-Date: 2014-01-13
+Date: 2014-01-14
 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph",
         "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko",
         "Korpela", role = c("aut", "trl")), person("Franco", "Biondi",

Modified: pkg/dplR/R/detrend.R
===================================================================
--- pkg/dplR/R/detrend.R	2014-01-14 01:19:07 UTC (rev 722)
+++ pkg/dplR/R/detrend.R	2014-01-14 08:27:05 UTC (rev 723)
@@ -2,8 +2,7 @@
     function(rwl, y.name = names(rwl), make.plot = FALSE,
              method=c("Spline", "ModNegExp", "Mean"),
              nyrs = NULL, f = 0.5, pos.slope = FALSE,
-             constrain.modnegexp = "never")
-             #constrain.modnegexp = c("never", "when.fail", "always"))
+             constrain.modnegexp = c("never", "when.fail", "always"))
 {
     stopifnot(identical(make.plot, TRUE) || identical(make.plot, FALSE),
               identical(pos.slope, FALSE) || identical(pos.slope, TRUE))

Modified: pkg/dplR/R/detrend.series.R
===================================================================
--- pkg/dplR/R/detrend.series.R	2014-01-14 01:19:07 UTC (rev 722)
+++ pkg/dplR/R/detrend.series.R	2014-01-14 08:27:05 UTC (rev 723)
@@ -2,8 +2,7 @@
     function(y, y.name = "", make.plot = TRUE,
              method = c("Spline", "ModNegExp", "Mean"),
              nyrs = NULL, f = 0.5, pos.slope = FALSE,
-             constrain.modnegexp = "never")
-             #constrain.modnegexp = c("never", "when.fail", "always"))
+             constrain.modnegexp = c("never", "when.fail", "always"))
 {
     stopifnot(identical(make.plot, TRUE) || identical(make.plot, FALSE),
               identical(pos.slope, FALSE) || identical(pos.slope, TRUE))
@@ -61,11 +60,11 @@
                 if(fits[1] < fits[length(fits)]) stop()
                 if(fits[length(fits)] <= 0) stop()
             }
-            # put in a check on fits here and warn if negative? 
+            # put in a check on fits here and warn if negative?
             fits
         }
         ModNegExp <- try(nec.func(y2, constrain2), silent=TRUE)
-        
+
         if(class(ModNegExp)=="try-error") {
             ## Straight line via linear regression
             tm <- cbind(1, seq_along(y2))



More information about the Dplr-commits mailing list