-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
I've posted this on Stack Overflow: tidyterra allows use of facet_wrap(~lyr)
to plot multiple spatial raster layers in one figure.
library(terra)
library(ggplot2)
library(tidyterra)
x <- rast(array(data = rnorm(120,0,1), dim=c(5,5,4)))
names(x) <- c("A_1", "B_1", "A_2", "B_2")
ggplot() +
geom_spatraster(data = x) +
facet_wrap(~lyr)
Is there any way of implementing facet_grid
in tidyterra so that, in the case above for example, the rows would be labelled 1 and 2, and columns would be labelled A and B?
This would require a spatraster object to have more than one attribute (the name of the layer) associated with it, I guess. I don't know if a data.frame can be associated with a spatraster object in which each row refers to a layer?
Metadata
Metadata
Assignees
Labels
No labels