ipdw (version 0.2-9)

pathdistGen: Generate a stack of path distance raster objects

Description

Generate a stack of path accumulated distance raster objects

Usage

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

Arguments

spdf

SpatialPointsDataFrame object

costras

RasterLayer cost raster

range

numeric. Range of interpolation neighborhood

yearmon

character. String specifying the name of the spdf

progressbar

logical show progressbar during processing?

Value

RasterStack object of path distances

Examples

Run this code
# NOT RUN {
spdf <- data.frame(rnorm(2))
xy <- data.frame(x = c(4, 2), y = c(8, 4))
coordinates(spdf) <- xy

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(spdf, costras, 100, progressbar = FALSE)
# }

Run the code above in your browser using DataCamp Workspace