0

If I have a spatraster with 6 layers, rasterVis::levelplot will give a 2 rows and 3 columns plot.

How can I change it to 3 rows and 2columns?

library(rasterVis)
library(terra)

f <- system.file("external/test.grd", package="raster")

rt1 <- rast(f)
rt2 <- rast(f)
rt3 <- rast(f)
rt4 <- rast(f)
rt5 <- rast(f)
rt6 <- rast(f)

rt <- c(rt1,rt2,rt3,rt4,rt5,rt6)

names(rt) <- LETTERS[1:6]

levelplot(rt)

enter image description here

1 Answer 1

0

You can do

levelplot(rt, layout = c(2, 3)) 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.