[R] Trellis Plots: translating lattice xyplot() to ggplot()

Rich Shepard rshepard at appl-ecosys.com
Sat Jul 11 15:06:07 CEST 2015


On Fri, 10 Jul 2015, Yihui Xie wrote:

> Your LyX example has two problems: 1) We don't have your .RData; 2) You
> didn't library(reshape) and library(lattice). Hence it is not a
> self-contained reproducible example.

Yihui,

   I assumed that reading in the *.csv file would create a local .RData file.

   Here, lattice and reshape2 are loaded when R is invoked. However,
explicitly loading them in the embedded code will be done.

> After fixing these two issues, I don't see why lattice graphics can be
> problematic with knitr. There is no need to print() the plot, and no
> need to pdf(), either. See the attached PDF I generated.

   I'll see if requireing those two libraries in the document resolves the
issue. Initially, I did not specify pdf() and added the explicit print()
based on that suggestion in this thread.

   Will test later today.

Thanks very much,

Rich



More information about the R-help mailing list