if (grassStarted()) {
# Setup
library(terra)
# Example data
madElev <- fastData("madElev")
elev <- fast(madElev)
# Calculate flow accumulation and watershed basins
water <- flow(elev, return = c("accum", "basins"))
water
elevWater <- c(elev, water)
plot(elevWater)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.