[R] Problem when combining dotplot() and textplot() using grid
drunken.wallaby at gmail.com
Wed Jun 11 07:40:44 CEST 2008
I want to solve the following problem. I have a data.frame and I
create a dotplot using lattice.
Then I want to use the grid-package to create a combined graphic which
contains the dotplot as well as a textplot() (using package gplots) of
the data.frame next to the dotplot.
xx <- data.frame(f=factor(rep(1:5, each=5)), gr= rep(c("gr1", "gr2",
"gr3", "gr4", "gr5"), 5), val=rnorm(25))
pushViewport(viewport(layout = grid.layout(1, 2)))
p <- dotplot(f ~ val, groups=gr, xx, cex=1.7, pch=20)
Obviously, this does not work since textplot() seems to call plot.new
no matter what options are set with par().
My question: Is it possible to archieve my goal to plot the data.frame
with textplot() next to the dotplot?
And furthermore, if it is possible to do so, is it even possible to
adjust the textplot in a way that the each row of the data.frame when
plotted using textplot() is at the same height than the corresponding
row in the dotplot? I guess that this is quite tricky and any hint on
which package or functions I could use would be very helpful.
Thank you very much.
More information about the R-help