Running ‘testanimate.R’
  Running ‘testattrib.R’
  Running ‘testball.R’
  Running ‘testclasses.R’
  Running ‘testclippath.R’
  Running ‘testcomment.R’
  Running ‘testelement.R’
  Running ‘testfilter.R’
  Running ‘testforce.R’
  Running ‘testgradientfill.R’
  Running ‘testgrid.R’
  Running ‘testid.R’
  Running ‘testlink.R’
  Running ‘testmask.R’
  Running ‘testpath.R’
  Running ‘testpatternfill.R’
  Running ‘testpendulum.R’
  Running ‘testplot.R’
  Running ‘testplotmath.R’
  Running ‘testpolyline.R’
  Running ‘testprefix.R’
  Running ‘testrotate.R’
  Running ‘testsvg.R’
  Running ‘testtransparency.R’
  Running ‘testvp.R’
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