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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 23 15:22:42 CET 2015


Author: mvkorpel
Date: 2015-03-23 15:22:41 +0100 (Mon, 23 Mar 2015)
New Revision: 977

Modified:
   pkg/dplR/ChangeLog
   pkg/dplR/R/series.rwl.plot.R
Log:
Worked around a problem in graphics::abline().


Modified: pkg/dplR/ChangeLog
===================================================================
--- pkg/dplR/ChangeLog	2015-03-23 13:18:32 UTC (rev 976)
+++ pkg/dplR/ChangeLog	2015-03-23 14:22:41 UTC (rev 977)
@@ -95,6 +95,14 @@
 - Fixed a bug where redfit() would fail if the "stats" package was
   not attached.
 
+File: series.rwl.plot.R
+-----------------------
+
+- Worked around a problem in graphics::abline(): the function
+  fails when a linear model is given and the "stats" package is not
+  attached. The solution is to extract the coefficients of the model
+  and use those in the call.
+
 File: write.tridas.R
 --------------------
 

Modified: pkg/dplR/R/series.rwl.plot.R
===================================================================
--- pkg/dplR/R/series.rwl.plot.R	2015-03-23 13:18:32 UTC (rev 976)
+++ pkg/dplR/R/series.rwl.plot.R	2015-03-23 14:22:41 UTC (rev 977)
@@ -98,7 +98,7 @@
          ylab=gettext("Master", domain="R-dplR"),
          xlab=gettext("Series", domain="R-dplR"), pch=20,
          sub=bquote(R^2==.(tmp)))
-    abline(lm1, lwd=2)
+    abline(coef = coef(lm1), lwd=2)
 
     ## plot 3
     plot(yrs, series2, type="n", ylim=c(-1, 1), ylab="",



More information about the Dplr-commits mailing list