baptiste / gridExtra

Miscellaneous Functions for "Grid" Graphics
http://cran.r-project.org/web/packages/gridExtra/index.html
15 stars 4 forks source link

str() throws an error #12

Closed bryanhanson closed 9 years ago

bryanhanson commented 9 years ago

Baptiste, I was playing around as a follow up to your assistance on SO when I discovered this:

g <- tableGrob(iris[1:4, 1:3])
str(g)

which throws an error when reporting on the very last element, which looks like something obsolete:

[snip]
$ gp      : NULL
$ vp      : NULL
$ NA:Error in object[[i]] : subscript out of bounds

I tried to determine if this came from gtable but the simple examples I tried did not give the error.

baptiste commented 9 years ago

Thanks, I think it's related to this old report,

http://stackoverflow.com/questions/17127339/calling-str-on-a-object-errors-out-if-the-ggplot2-package-is-loaded

It looks like it's a bug in grid or gtable, I think DWin was onto something.

bryanhanson commented 9 years ago

Ah, alright. Interesting thread. I guess people are not too motivated to follow such an obscure problem. Thanks.

baptiste commented 9 years ago

this seems a decent fix, I'm unsure where to put it though http://stackoverflow.com/a/31552112/471093 for now it's in gridExtra