Can we include subscript/superscript characters in rasterVis::levelplot
strip labels?
Consider the following RasterStack
, s
:
library(rasterVis)
s <- stack(replicate(2, raster(matrix(runif(9), 3))))
The default plot method for Raster*
objects allows expressions to be passed to the main
argument:
plot(s, main=expression(Something, Something[2]))
With rasterVis::levelplot
, strip names are passed via the names.attr
argument, but it seems these are coerced to character
before eventually being passed to lattice::levelplot
with strip.custom(factor.levels = names.attr)
.
The result is:
levelplot(s, names.attr=expression(Something, Something[2]))
Short of modifying the source, is there a way to use expressions (or otherwise achieve subscript/superscript characters) in strip labels of rasterVis::levelplot
?