Generate a stack of path accumulated distance raster objects
pathdistGen(sf_ob, costras, range, yearmon = "default", progressbar = TRUE)
sf object with point geometries
RasterLayer cost raster
numeric. Range of interpolation neighborhood
character. String specifying the name of the sf_ob
logical show progressbar during processing?
RasterStack object of path distances
library(sf)
sf_ob <- data.frame(rnorm(2))
xy <- data.frame(x = c(4, 2), y = c(8, 4))
sf_ob <- st_as_sf(cbind(sf_ob, xy), coords = c("x", "y"))
m <- matrix(NA, 10, 10)
costras <- raster(m, xmn = 0, xmx = ncol(m), ymn = 0, ymx = nrow(m))
costras[] <- runif(ncell(costras), min = 1, max = 10)
# introduce spatial gradient
for (i in 1:nrow(costras)) {
costras[i, ] <- costras[i, ] + i
costras[, i] <- costras[, i] + i
}
rstack <- pathdistGen(sf_ob, costras, 100, progressbar = FALSE)