Description Usage Arguments Value Examples
Calculates the accumulated cost of travel from one or more points.
1 | hf_accCost(x, points, fun = function(x) 1/mean(x))
|
x |
A |
points |
A |
fun |
A function to calculate transition weights from the raster. |
A RasterLayer
with accumulated travel costs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | ## Not run:
library(raster)
library(rHike)
library(sf)
dem <- raster(system.file("extdata/slc.tif", package = "rHike"))
slope <- hf_slope(dem)
velocity <- hf_velocity(slope, hf = "campbell", decile = 30)
start_points <- st_sf(id = 1:3,
geometry = st_sfc(st_point(c(424350, 4514200)),
st_point(c(426000, 4515000)),
st_point(c(429000, 4516500)),
crs = 26912))
acc_cost <- hf_accCost(velocity, start_points)
plot(acc_cost)
plot(st_geometry(start_points), color = "red", add = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.