r <- terra::rast(system.file("extdata/SICILY_1000m.tif", package="leastcostpath"))
cs1 <- create_cs(x = r, neighbours = 16, dem = NULL, max_slope = NULL)
cs2 <- create_cs(x = r, neighbours = 16, dem = r, max_slope = 10)
Run the code above in your browser using DataLab