Layoutfunktion im Levelplot verwenden
Ich mache Mapping in R und fand die sehr nützlichelevelplot
Funktion inrasterVis
package. Ich möchte mehrere Diagramme in einem Fenster anzeigen. Jedoch,par(mfcol)
passt nicht inlattice
. Ich fandlayout
-Funktion ist in meinem Fall sehr nützlich, führt aber nicht das aus, was ich tun möchte.
Hier ist mein Code:
s <- stack(Precip_DJF1, Precip_DJF2, Precip_DJF3, Precip_DJF4,
Precip_DJF5, Precip_DJF6)
levelplot(s, layout(matrix(c(1, 2, 0, 3, 4, 5), 2, 3)),
at=seq(floor(3.81393), ceiling(23.06363), length.out=20),
par.settings=themes, par.strip.text=list(cex=0),
scales=list(alternating=FALSE))
Mit
layout(matrix(c(1, 2, 0, 3, 4, 5), 2, 3))
fails whilelayout(3, 2)
funktioniert, aber die Diagramme werden zeilenweise statt spaltenweise angezeigt. Ich möchte, dass die Diagramme in Spalte 1, dann in Spalte 2 usw. angezeigt werde
mat <- matrix(c(1, 2, 3, 4, 5, 6), 2, 3)
> mat
# [,1] [,2] [,3]
# [1,] 1 3 5
# [2,] 2 4 6
Gibt es eine Funktion innerhalb vonlevelplot
oderlattice
Um diese Art von Layout zu machen?
Danke im Voraus