Learn R Programming

ipdw (version 2.0-0)

pathdistGen: Generate a stack of path distance raster objects

Description

Generate a stack of path accumulated distance raster objects

Usage

pathdistGen(sf_ob, costras, range, yearmon = "default", progressbar = TRUE)

Value

RasterStack object of path distances

Arguments

sf_ob

sf object with point geometries

costras

RasterLayer cost raster

range

numeric. Range of interpolation neighborhood

yearmon

character. String specifying the name of the sf_ob

progressbar

logical show progressbar during processing?

Examples

Run this code
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)

Run the code above in your browser using DataLab