[R] Sweave, ggplot2 and two-page figures

Aric Gregson aorchid at mac.com
Wed Jun 11 00:20:29 CEST 2008


I am using Sweave to generate a document in which ggplot2 figures are
embedded. I am using the following code in a particular plot within a
subfloat environment:

<<qplotARbosreg, echo = FALSE, fig = TRUE>>=
print(qplot(bosday2, Arday2, data= arbostimearonlyNArm,
colour=factor(bos2), shape=factor(bos2), size=factor(cumARscore),
position="jitter", main="Days to BOS by Days to First AR", xlab="Days of
Follow-up", ylab="Daysto First AR") + geom_smooth(aes(group=bos2),
method='rlm', fill=alpha("grey", 0.4)) +
 scale_shape(solid=FALSE,name="BOS\nFalse = 0\nTrue = 1") +  
 scale_size_identity() + facet_grid(bos2 ~ ., margins=TRUE)
+scale_colour_manual(name="BOS\nFalse = 0\nTrue = 1", values=c("blue",
"purple")))
grid.gedit(gPath("strip","label"),gp=gpar(fontsize="14", col="red"))
@ 

I am unable to get the plot with the modified strip labels to be
included. It is created as the second page of the first plot and only
the first page is included in the latex document. I want the second page
of the plot, not the first page. 

Thanks for any assistance. 

aric

(R version 2.7.0)



More information about the R-help mailing list