library(terra)
library(geospaar)
# data(dem)
topo <- lapply(c("TRI", "flowdir"), function(x) terrain(rast(dem), x))
png(here::here("docs/figures/zambia_topo.png"),
width = 7, height = 2.5, res = 300, units = "in", bg = "grey")
par(mfrow = c(1, 2))#, mar = c(0, 1, 2, 4), oma = c(0, 1, 0, 2))
plot(topo[[1]], mar = c(0.5, 1, 1, 4), main = "TRI", axes = FALSE)
plot(topo[[2]], mar = c(0.5, 1, 1, 4), main = "Flow Direction", axes = FALSE)
dev.off()