2

いくつかのレベルプロットのトレリスを生成しようとしています。今、私は2つの問題を抱えています。ここにいくつかのサンプルデータがあります

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)")

これにより、次のプロットが生成されます。ここに画像の説明を入力

1) すべてのプロットのタイトルを放射線ではなく、放射線の値 (例: 7,334,...) にしたい

2) 現在の数値ではなく、x 軸と y 軸の目盛りを文字に変更したい。(5-10-15-20 の代わりに EJOT が必要です)

正しい方向に(もう一度)私を向けることができますか?

4

1 に答える 1

5

使用して

levelplot(fit ~ wind * temperature | as.factor(radiation), ... , scales= list(x=list(labels=c('','E','J','O','T'))))

放射値でプロットにラベルを付けます。scales 引数を使用して、さまざまなラベルを指定できます。

于 2011-05-25T07:35:15.190 に答える