if (grassStarted()) {
# Setup
library(terra)
# Example data
madElev <- fastData("madElev")
# Convert a SpatRaster to a GRaster
elev <- fast(madElev)
# Calculate stream channels
streams <- streams(elev)
plot(streams)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.