[Dplr-commits] r1005 - in pkg/dplR: . man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 3 23:44:49 CET 2015


Author: mvkorpel
Date: 2015-11-03 23:44:49 +0100 (Tue, 03 Nov 2015)
New Revision: 1005

Modified:
   pkg/dplR/DESCRIPTION
   pkg/dplR/man/rasterPlot.Rd
Log:
Improved example


Modified: pkg/dplR/DESCRIPTION
===================================================================
--- pkg/dplR/DESCRIPTION	2015-11-02 15:46:12 UTC (rev 1004)
+++ pkg/dplR/DESCRIPTION	2015-11-03 22:44:49 UTC (rev 1005)
@@ -3,7 +3,7 @@
 Type: Package
 Title: Dendrochronology Program Library in R
 Version: 1.6.4
-Date: 2015-11-02
+Date: 2015-11-04
 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/man/rasterPlot.Rd
===================================================================
--- pkg/dplR/man/rasterPlot.Rd	2015-11-02 15:46:12 UTC (rev 1004)
+++ pkg/dplR/man/rasterPlot.Rd	2015-11-03 22:44:49 UTC (rev 1005)
@@ -90,12 +90,47 @@
 }
 \examples{library(graphics)
 library(stats)
-foo <- runif(5, min = 1, max = 5)
-plot(foo, type = "n", axes = FALSE, ylim = c(1, 5))
-rasterPlot(quote(points(foo)))
+x <- 1:100
+y0 <- quote(sin(pi * x / 20) + x / 100 + rnorm(100, 0, 0.2))
+y <- eval(y0)
+ylab <- deparse(y0)
+spl <- smooth.spline(y)
+plot(x, y, type = "n", axes = FALSE, ylab = ylab)
+usr <- par("usr")
+xrange <- usr[2] - usr[1]
+xsize <- xrange * 0.4
+nsteps <- 8
+xmar <- xsize / 20
+yrange <- usr[4] - usr[3]
+ysize <- yrange / 20
+ymar <- 0.5 * ysize
+X <- seq(usr[1] + xmar, by = xsize / nsteps, length.out = nsteps + 1)
+xleft <- X[-(nsteps + 1)]
+xright <- X[-1]
+maxrad <- xsize / 3
+nrad <- 16
+minrad <- maxrad / nrad
+Rad <- seq(maxrad, by = (minrad - maxrad) / (nrad - 1), length.out=nrad)
+expr <- quote({
+    rect(xleft, usr[4] - 1.5 * ysize, xright, usr[4] - ymar,
+         col = rainbow(8), border = NA)
+    symbols(rep(usr[2] - xmar - maxrad, nrad),
+            rep(usr[3] + ymar + maxrad / xrange * yrange, nrad),
+            circles = Rad, inches = FALSE, add = TRUE, fg = NA,
+            bg = gray.colors(nrad + 1, 1, 0)[-1])
+    points(y)
+    lines(spl)
+})
+rasterPlot(expr, res = 50)
 box()
 axis(1)
 axis(2)
+
+plot(x, y, type = "n", axes = FALSE, ylab = ylab)
+rasterPlot(expr, antialias = "none", interpolate = FALSE)
+box()
+axis(1)
+axis(2)
 }
 \keyword{ aplot }
 \keyword{ utilities }



More information about the Dplr-commits mailing list