[R] [lattice] how to label panels with variable value (not name)?

Tom Roche Tom_Roche at pobox.com
Sun Nov 18 15:43:34 CET 2012


As described @

https://stat.ethz.ch/pipermail/r-help/2012-November/329442.html

I now know how to prepare my netCDF data specifying gas concentrations
over a 3D space (dimensions longitude, latitude, and (vertical) level),
so as to call lattice::levelplot() like

levelplot(conc ~ lon * lat | lev, data=data.frame)

which labels each panel in the lattice of plots with the name "lev" plus
a graphical indicator of the level value. Alternatively, I can label
each panel with an index (i.e., "1", "2", ...) by calling

levelplot(conc ~ lon * lat | factor(lev), data=data.frame)

However I will need to before-and-after compare this to the results of a
reboxing, or 3D regridding, of this data, so I would prefer instead to
label each panel in the lattice with the _value_ of the level (an
atmospheric pressure), rather than the name or index of the level.
How to do that?

TIA, Tom Roche <Tom_Roche at pobox.com>



More information about the R-help mailing list