The function View()
seems to have problems when applied to objects of class "gtable"
. Example:
g <- ggplot2::ggplotGrob(
ggplot2::ggplot(mtcars) + ggplot2::geom_point(aes(cyl, disp)))
View(g)
Error message: Error in names[[i]] : subscript out of bounds
Potentially, this is related to the fact that the class has overwritten the length-function:
length(g) # gives 18
length(unclass(g)) # gives 12