2
内の格子グラフから選択されたパネルを印刷するループを作成し、latticeExtra 別のページで、毎週の気温11が1ページになるようにします。私はこれを手動で行うことができますが、それを行うにはループを使用する方法が必要であることがわかります。誰でも??ここで プロットに生成するために使用されるデータである<img src="https://i.stack.imgur.com/sRnXZ.jpg" alt="enter image description here"></p> <p>を私は格子内の次のプロットを生成した独立したページ
rate <- structure(list(Temp = c("11°C", "11°C", "11°C", "11°C", "11°C",
"11°C", "11°C", "11°C", "11°C", "11°C", "11°C", "11°C", "11°C",
"11°C", "11°C", "11°C", "13°C", "13°C", "13°C", "13°C", "13°C",
"13°C", "13°C", "13°C", "13°C", "13°C", "13°C", "13°C", "13°C",
"13°C", "13°C", "13°C", "15°C", "15°C", "15°C", "15°C", "15°C",
"15°C", "15°C", "15°C", "15°C", "15°C", "15°C", "15°C", "15°C",
"15°C", "15°C", "15°C"), Rep = c("1", "1", "1", "1", "1", "1",
"1", "1", "2", "2", "2", "2", "2", "2", "2", "2", "1", "1", "1",
"1", "1", "1", "1", "1", "2", "2", "2", "2", "2", "2", "2", "2",
"1", "1", "1", "1", "1", "1", "1", "1", "2", "2", "2", "2", "2",
"2", "2", "2"), Ind = c(12L, 12L, 12L, 12L, 14L, 14L, 14L, 14L,
11L, 11L, 11L, 11L, 10L, 10L, 10L, 10L, 2L, 2L, 2L, 2L, 7L, 7L,
7L, 7L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 5L, 5L,
5L, 5L, 8L, 8L, 8L, 8L, 13L, 13L, 13L, 13L), Week = c("1", "2",
"3", "4", "1", "2", "3", "4", "1", "2", "3", "4", "1", "2", "3",
"4", "1", "2", "3", "4", "1", "2", "3", "4", "1", "2", "3", "4",
"1", "2", "3", "4", "1", "2", "3", "4", "1", "2", "3", "4", "1",
"2", "3", "4", "1", "2", "3", "4"), Weight = c(0.2099, 0.2099,
0.2099, 0.2099, 0.3483, 0.3483, 0.3483, 0.3483, 0.3724, 0.3724,
0.3724, 0.3724, 0.2751, 0.2751, 0.2751, 0.2751, 0.2562, 0.2562,
0.2562, 0.2562, 0.3842, 0.3842, 0.3842, 0.3842, 0.3206, 0.3206,
0.3206, 0.3206, 0.4803, 0.4803, 0.4803, 0.4803, 0.7392, 0.7392,
0.7392, 0.7392, 0.277, 0.277, 0.277, 0.277, 0.082, 0.082, 0.082,
0.082, 0.5663, 0.5663, 0.5663, 0.5663), Rate = c(13.733, 9.322,
12.46, 6.581, 2.338, 2.652, 2.772, 3.026, 1.554, 1.677, 2.127,
2.102, 2.522, 2.476, 2.847, 2.999, 1.764, 2.442, 2.877, 2.976,
2.479, 2.532, 2.874, 3.052, 1.724, 2.292, 2.405, 2.397, 1.553,
3.385, 3.178, 2.959, 0.687, 0.808, 1.042, 1.033, 2.255, 2.755,
2.878, 3.338, 4.515, 5.089, 7.349, 8.113, 1.185, 1.649, 2.382,
1.989)), .Names = c("Temp", "Rep", "Ind", "Week", "Weight", "Rate"
), row.names = c(NA, -48L), class = "data.frame")
私はtrellis.device()を使用しました。この場合、pdf(onefile = false)を設定する必要はありません。プロットごとに新しいグラフィックデバイスが開きます – BDM