SCM

SCM Repository

[latticeextra] Diff of /pkg/R/tileplot.R
ViewVC logotype

Diff of /pkg/R/tileplot.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 193, Thu Dec 31 10:45:11 2015 UTC revision 194, Fri Jan 1 11:17:13 2016 UTC
# Line 21  Line 21 
21               ...,               ...,
22               col.regions = regions$col, alpha.regions = regions$alpha)               col.regions = regions$col, alpha.regions = regions$alpha)
23  {  {
24        ## We need either tripack (better? but weird license) or
25        ## deldir. Go with deldir unless explicitly requested.
26      if (use.tripack) {      if (use.tripack) {
27          if (!require("tripack", quietly = TRUE))          if (!requireNamespace("tripack", quietly = TRUE))
28              stop("The use.tripack option requires the tripack package")              stop("The 'use.tripack=TRUE' option requires the 'tripack' package to be installed.")
29      } else {      } else {
30          if (!require("deldir", quietly = TRUE))          if (!requireNamespace("deldir", quietly = TRUE))
31              stop("This function requires the deldir package")              stop("This function requires the 'deldir' package to be installed.")
32      }      }
33      ## find subset of points to use      ## find subset of points to use
34      x0 <- x[subscripts]      x0 <- x[subscripts]
# Line 67  Line 69 
69          ## add dummy points to ensure that voronoi polygons are finite          ## add dummy points to ensure that voronoi polygons are finite
70          dummies <- data.frame(x = c(-1,-1,1,1), y = c(-1,1,-1,1)) * 10 * max(abs(xy))          dummies <- data.frame(x = c(-1,-1,1,1), y = c(-1,1,-1,1)) * 10 * max(abs(xy))
71          xy <- rbind(xy, dummies)          xy <- rbind(xy, dummies)
72          tiles <- voronoi.polygons(voronoi.mosaic(xy, duplicate = "error"))          tiles <- tripack::voronoi.polygons(tripack::voronoi.mosaic(xy, duplicate = "error"))
73      } else {      } else {
74          ## NB: the 'rw' argument as subset of data is bad because          ## NB: the 'rw' argument as subset of data is bad because
75          ## need to take corresponding subset of z !          ## need to take corresponding subset of z !
# Line 78  Line 80 
80          #x <- x[set]          #x <- x[set]
81          #y <- y[set]          #y <- y[set]
82          #z <- z[set]          #z <- z[set]
83          tiles <- tile.list(deldir(x, y, rw = bounds))          tiles <- deldir::tile.list(deldir::deldir(x, y, rw = bounds))
84          tiles <- lapply(tiles, function(p) as.data.frame(p[c("x", "y")]))          tiles <- lapply(tiles, function(p) as.data.frame(p[c("x", "y")]))
85      }      }
86      ## draw it as one composite polygon      ## draw it as one composite polygon

Legend:
Removed from v.193  
changed lines
  Added in v.194

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge