From felix at nfrac.org  Mon Jul 28 09:44:49 2008
From: felix at nfrac.org (Felix Andrews)
Date: Mon, 28 Jul 2008 17:44:49 +1000
Subject: [Rd] grid.ls() after grid.remove() fails
Message-ID: <94730b8a0807280044g2fc2a3e2ue18ada3fbc14259b@mail.gmail.com>

Dr Murrell and others,

It seems grid.ls() fails after any use of grid.remove(). It gives an
infinite recursion error even in the simplest cases, and no matter
what arguments are passed to grid.ls.

> library(grid)
> grid.newpage()
> grid.lines(name="foo")
> grid.ls()
foo
> grid.remove("foo")
> grid.ls()
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
> grid.ls(recursive=FALSE)
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
> str(grid.ls(print=FALSE))
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
> traceback()
...etc...
...etc...
...etc...
13: gridList.default(X[[2L]], ...)
12: FUN(X[[2L]], ...)
11: lapply(display.list[1:dl.index], gridList, grobs = grobs,
viewports = viewports,
        fullNames = fullNames, recursive = recursive)
10: gridList.default(X[[2L]], ...)
9: FUN(X[[2L]], ...)
8: lapply(display.list[1:dl.index], gridList, grobs = grobs, viewports
= viewports,
       fullNames = fullNames, recursive = recursive)
7: gridList.default(X[[2L]], ...)
6: FUN(X[[2L]], ...)
5: lapply(display.list[1:dl.index], gridList, grobs = grobs, viewports
= viewports,
       fullNames = fullNames, recursive = recursive)
4: gridList.default(x, grobs = grobs, viewports = viewports, fullNames
= fullNames,
       recursive = recursive)
3: gridList(x, grobs = grobs, viewports = viewports, fullNames = fullNames,
       recursive = recursive)
2: grid.ls(print = FALSE)
1: str(grid.ls(print = FALSE))


> str(current.vpTree())
List of 17
 $ x             :Class 'unit'  atomic [1:1] 0.5
  .. ..- attr(*, "unit")= chr "npc"
  .. ..- attr(*, "valid.unit")= int 0
 $ y             :Class 'unit'  atomic [1:1] 0.5
  .. ..- attr(*, "unit")= chr "npc"
  .. ..- attr(*, "valid.unit")= int 0
 $ width         :Class 'unit'  atomic [1:1] 1
  .. ..- attr(*, "unit")= chr "npc"
  .. ..- attr(*, "valid.unit")= int 0
 $ height        :Class 'unit'  atomic [1:1] 1
  .. ..- attr(*, "unit")= chr "npc"
  .. ..- attr(*, "valid.unit")= int 0
 $ justification : chr "centre"
 $ gp            : list()
  ..- attr(*, "class")= chr "gpar"
 $ clip          : logi TRUE
 $ xscale        : num [1:2] 0 558
 $ yscale        : num [1:2] 557 0
 $ angle         : num 0
 $ layout        : NULL
 $ layout.pos.row: NULL
 $ layout.pos.col: NULL
 $ valid.just    : num [1:2] 0.5 0.5
 $ valid.pos.row : NULL
 $ valid.pos.col : NULL
 $ name          : chr "ROOT"
 - attr(*, "class")= chr "viewport"


> sessionInfo()
R version 2.8.0 Under development (unstable) (2008-07-26 r46127)
i386-pc-mingw32

locale:
LC_COLLATE=English_Australia.1252;LC_CTYPE=English_Australia.1252;LC_MONETARY=English_Australia.1252;LC_NUMERIC=C;LC_TIME=English_Australia.1252

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods
[8] base


-- 
Felix Andrews / ???
PhD candidate
Integrated Catchment Assessment and Management Centre
The Fenner School of Environment and Society
The Australian National University (Building 48A), ACT 0200
Beijing Bag, Locked Bag 40, Kingston ACT 2604
http://www.neurofractal.org/felix/
3358 543D AAC6 22C2 D336 80D9 360B 72DD 3E4C F5D8



[Rd] grid.ls() after grid.remove() fails
Felix Andrews