# NOT RUN {
r <- raster::raster(system.file('external/maungawhau.grd', package = 'gdistance'))
slope_cs <- create_slope_cs(r, cost_function = 'tobler', neighbours = 16)
loc1 = cbind(2667670, 6479000)
loc1 = sp::SpatialPoints(loc1)
loc2 = cbind(2667800, 6479400)
loc2 = sp::SpatialPoints(loc2)
cost_corridor <- create_cost_corridor(slope_cs, loc1, loc2, rescale = FALSE)
# }
Run the code above in your browser using DataLab