Running ‘testanimate.R’ [3s/4s]
  Running ‘testattrib.R’ [1s/1s]
  Running ‘testball.R’ [2s/3s]
  Running ‘testclasses.R’ [1s/1s]
  Running ‘testclippath.R’ [2s/2s]
  Running ‘testcomment.R’ [1s/1s]
  Running ‘testelement.R’ [1s/1s]
  Running ‘testfilter.R’ [1s/1s]
  Running ‘testforce.R’ [1s/2s]
  Running ‘testgradientfill.R’ [1s/1s]
  Running ‘testgrid.R’ [1s/1s]
  Running ‘testid.R’ [1s/1s]
  Running ‘testlink.R’ [2s/3s]
  Running ‘testmask.R’ [2s/3s]
  Running ‘testpath.R’ [1s/2s]
  Running ‘testpatternfill.R’ [1s/2s]
  Running ‘testpendulum.R’ [1s/1s]
  Running ‘testplot.R’ [4s/4s]
  Running ‘testplotmath.R’ [9s/10s]
  Running ‘testpolyline.R’ [1s/1s]
  Running ‘testprefix.R’ [1s/1s]
  Running ‘testrotate.R’ [9s/11s]
  Running ‘testsvg.R’ [1s/1s]
  Running ‘testtransparency.R’ [1s/2s]
  Running ‘testvp.R’ [1s/2s]
Running the tests in ‘tests/testpath.R’ failed.
Complete output:
  > 
  > library(grid)
  > require(gridSVG)
  Loading required package: gridSVG
  
  Attaching package: 'gridSVG'
  
  The following object is masked from 'package:grDevices':
  
      dev.off
  
  > 
  > example(grid.path)
  
  grd.pt> pathSample <- function(x, y, rule, gp = gpar()) {
  grd.pt+     if (is.na(rule))
  grd.pt+         grid.path(x, y, id = rep(1:2, each = 4), gp = gp)
  grd.pt+     else
  grd.pt+         grid.path(x, y, id = rep(1:2, each = 4), rule = rule, gp = gp)
  grd.pt+     if (!is.na(rule))
  grd.pt+         grid.text(paste("Rule:", rule), y = 0, just = "bottom")
  grd.pt+ }
  
  grd.pt> pathTriplet <- function(x, y, title) {
  grd.pt+     pushViewport(viewport(height = 0.9, layout = grid.layout(1, 3),
  grd.pt+                           gp = gpar(cex = .7)))
  grd.pt+     grid.rect(y = 1, height = unit(1, "char"), just = "top",
  grd.pt+               gp = gpar(col = NA, fill = "grey"))
  grd.pt+     grid.text(title, y = 1, just = "top")
  grd.pt+     pushViewport(viewport(layout.pos.col = 1))
  grd.pt+     pathSample(x, y, rule = "winding",
  grd.pt+                gp = gpar(fill = "grey"))
  grd.pt+     popViewport()
  grd.pt+     pushViewport(viewport(layout.pos.col = 2))
  grd.pt+     pathSample(x, y, rule = "evenodd",
  grd.pt+                gp = gpar(fill = "grey"))
  grd.pt+     popViewport()
  grd.pt+     pushViewport(viewport(layout.pos.col = 3))
  grd.pt+     pathSample(x, y, rule = NA)
  grd.pt+     popViewport()
  grd.pt+     popViewport()
  grd.pt+ }
  
  grd.pt> pathTest <- function() {
  grd.pt+     grid.newpage()
  grd.pt+     pushViewport(viewport(layout = grid.layout(5, 1)))
  grd.pt+     pushViewport(viewport(layout.pos.row = 1))
  grd.pt+     pathTriplet(c(.1, .1, .9, .9, .2, .2, .8, .8),
  grd.pt+                 c(.1, .9, .9, .1, .2, .8, .8, .2),
  grd.pt+                 "Nested rectangles, both clockwise")
  grd.pt+     popViewport()
  grd.pt+     pushViewport(viewport(layout.pos.row = 2))
  grd.pt+     pathTriplet(c(.1, .1, .9, .9, .2, .8, .8, .2),
  grd.pt+                 c(.1, .9, .9, .1, .2, .2, .8, .8),
  grd.pt+                 "Nested rectangles, outer clockwise, inner anti-clockwise")
  grd.pt+     popViewport()
  grd.pt+     pushViewport(viewport(layout.pos.row = 3))
  grd.pt+     pathTriplet(c(.1, .1, .4, .4, .6, .9, .9, .6),
  grd.pt+                 c(.1, .4, .4, .1, .6, .6, .9, .9),
  grd.pt+                 "Disjoint rectangles")
  grd.pt+     popViewport()
  grd.pt+     pushViewport(viewport(layout.pos.row = 4))
  grd.pt+     pathTriplet(c(.1, .1, .6, .6, .4, .4, .9, .9),
  grd.pt+                 c(.1, .6, .6, .1, .4, .9, .9, .4),
  grd.pt+                 "Overlapping rectangles, both clockwise")
  grd.pt+     popViewport()
  grd.pt+     pushViewport(viewport(layout.pos.row = 5))
  grd.pt+     pathTriplet(c(.1, .1, .6, .6, .4, .9, .9, .4),
  grd.pt+                 c(.1, .6, .6, .1, .4, .4, .9, .9),
  grd.pt+                 "Overlapping rectangles, one clockwise, other anti-clockwise")
  grd.pt+     popViewport()
  grd.pt+     popViewport()
  grd.pt+ }
  
  grd.pt> pathTest()
  
  grd.pt> # Drawing multiple paths at once
  grd.pt> holed_rect <- cbind(c(.15, .15, -.15, -.15, .1, .1, -.1, -.1), 
  grd.pt+                     c(.15, -.15, -.15, .15, .1, -.1, -.1, .1))
  
  grd.pt> holed_rects <- rbind(
  grd.pt+     holed_rect + matrix(c(.7, .2), nrow = 8, ncol = 2, byrow = TRUE),
  grd.pt+     holed_rect + matrix(c(.7, .8), nrow = 8, ncol = 2, byrow = TRUE),
  grd.pt+     holed_rect + matrix(c(.2, .5), nrow = 8, ncol = 2, byrow = TRUE)
  grd.pt+ )
  
  grd.pt> grid.newpage()
  
  grd.pt> grid.path(x = holed_rects[, 1], y = holed_rects[, 2], 
  grd.pt+           id = rep(1:6, each = 4), pathId = rep(1:3, each = 8),
  grd.pt+           gp = gpar(fill = c('red', 'blue', 'green')),
  grd.pt+           rule = 'evenodd')
  
  grd.pt> # Not specifying pathId will treat all points as part of the same path, thus 
  grd.pt> # having same fill
  grd.pt> grid.newpage()
  
  grd.pt> grid.path(x = holed_rects[, 1], y = holed_rects[, 2], 
  grd.pt+           id = rep(1:6, each = 4),
  grd.pt+           gp = gpar(fill = c('red', 'blue', 'green')),
  grd.pt+           rule = 'evenodd')
  > 
  > grid.export("path.svg")
  Error in svgStyleAttributes(style, svgdev) : 
    All SVG style attribute values must have length 1
  Calls: grid.export ... devPath -> devPath -> svgPath -> svgStyleAttributes
  Execution halted