I have a short routine which arranges ggplot and grid graphics using the grid.arrange function in the package gridExtras. I need to render the output from my routine (which nominally prints using grid.draw, or returns the grid object as an option) in my Sweave documentation. I’m at a loss how to do this, since the say I’ve been using “print” doesn’t work the same way as with a pure ggplot graphic. I’ve tried:
g <- ggkm(survfit.object, returns=T)
print(g)
where g is the object created by grid.arrange, and has class
> class(g)
[1] "frame" "gTree" "grob" "gDesc"
Any help would be appreciated
Abhijit
Printing the object as it’s created rather than printing the saved object seems to work, although I couldn’t explain why …