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

Roy Mendelssohn - NOAA Federal roy.mendelssohn at noaa.gov
Fri Jul 10 23:16:20 CEST 2015


Don’t know for certain but might this help:

http://journal.r-project.org/archive/2015-1/murrell.pdf

From the latest issue of R Journal.  

Abstract The gridGraphics package provides a function, grid.echo(), that can be used to convert a plot drawn with the graphics package to a visually identical plot drawn using grid. This conversion provides access to a variety of grid tools for making customisations and additions to the plot that are not possible with the graphics package.

-Roy

> On Jul 10, 2015, at 2:09 PM, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> 
>  Hadley's ggplot2 book is quite old and a new version is in the works, but
> not yet out. I've been using lattice graphics but the knitr package doesn't
> support lattice, only basic plots and ggplot2. My Web searches for Trellis
> plots in ggplot2 equivalent to those in lattice have not been productive.
> 
>  I would appreciate a pointer to a resource that would teach me how to
> translate from lattice xyplot() to ggplot2 ggplot().
> 
>  This is one such plot needing translation:
> 
> xyplot(value ~ sampdate | variable, data=carlin.1.melt, rm.na = T)
> 
> Rich
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



More information about the R-help mailing list