[R] grid.remove() doesn't remove output

Zepu Zhang zpzhang at uchicago.edu
Thu Nov 10 21:44:11 CET 2005


I've found that grid.remove() doesn't clear the output when the grob is 
the only one on the device (or viewport; I didn't test it). For example:

library(grid)
grid.newpage()

grid.circle(name="cir", x=.5, y=.5, r=.3, gp=gpar(lwd=5))
grid.lines(c(.2, .8), c(.3, .7), name="lin")
grid.remove("cir")      # circle disappears
grid.remove("lin")      # object deleted, but line remains on output

If I now draw another primitive, "lin" disappears.

If I plotted only one thing, say "cir", in the first place,
grid.remove() won't clear the output.

I'm using R 2.2. Any pointer is appreciated.

Zepu




More information about the R-help mailing list