if (FALSE) {
x <- raster::raster(ncol=10, nrow=10, xmn=0, xmx=100, ymn=0, ymx=100)
raster::values(x) <- sample(c(1,2,3,4), size = 100, replace = TRUE)
pts <- data.frame(ID = 1:4,
x = c(10, 90, 10, 90),
y = c(90, 10, 10, 90))
cost <- data.frame(code = 1:4,
cost = c(1, 10, 100, 1000))
mat_cost_dist(raster = x,
pts = pts, cost = cost,
method = "gdistance")
}
Run the code above in your browser using DataLab