layers = red.examples("red.layers")
alt = layers[[3]]
records = red.examples("red.records")
par(mfrow=c(3,2))
terra::plot(alt)
points(records)
terra::plot(raster.distance(records, alt))
terra::plot(raster.distance(records, alt, type = "average"))
terra::plot(raster.distance(records, alt, type = "mcp"))
Run the code above in your browser using DataLab