I’m trying to generate a trellis of some levelplots. Now I got 2 issues.
Here is some sampledata
library(lattice)
require(stats)
attach(environmental)
ozo.m <- loess((ozone^(1/3)) ~ wind * temperature * radiation,
parametric = c("radiation", "wind"), span = 1, degree = 2)
w.marginal <- seq(min(wind), max(wind), length.out = 50)
t.marginal <- seq(min(temperature), max(temperature), length.out = 50)
r.marginal <- seq(min(radiation), max(radiation), length.out = 4)
wtr.marginal <- list(wind = w.marginal, temperature = t.marginal,
radiation = r.marginal)
grid <- expand.grid(wtr.marginal)
grid[, "fit"] <- c(predict(ozo.m, grid))
levelplot(fit ~ wind * temperature | radiation, data = grid,
cuts = 10, region = TRUE,
xlab = "Wind Speed (mph)",
ylab = "Temperature (F)",
main = "Cube Root Ozone (cube root ppb)")
This will generate the following plot.
1)
I want the title of every plot not to be radiation, but the value of the radiation (e.g. 7,334,…)
2) I want to change the ticks from the x and y axis to letters instead of the current numbers. (instead of 5-10-15-20 I need E-J-O-T)
Can you guys point me (once again) in the right direction?
using
will label your plots with the radiation value. the scales argument can be used to specify different labels.