irl_acc: Generate an accumulated cost surface from an irregular...

Description Usage Arguments Examples

View source: R/irl_acc.R

Description

Wraps the irl_graph, acc_path, and irl_acc functions

This high level function allows for generation of an accumulated cost surface from a single function call

Usage

1
2
irl_acc(dm, poicoords = NA, cutoff = 0, grainprop = 0.25, costsurf,
  scoord, snode = NULL, irregular = TRUE, warn = TRUE)

Arguments

dm

matrix 2d cost values

poicoords

matrix 2 column point-of-interest coordinates

cutoff

numeric between 0 and 1. Determines the threshold at which a cell is determined "very important"

grainprop

numeric proportion of cells to be included as "grain cells"

costsurf

raster cost surface

scoord

matrix matrix 2 column starting coordinates

snode

numeric starting node

irregular

logical skip irregular node subsetting routine?

warn

logical print warnings?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
set.seed(123) #make reproducible

dm <- as.matrix(read.delim(system.file(
"extdata/etherington20120code/cost-surface20x20.txt",
package = "irlgraph"), skip = 6, na.strings = "-9999", header = FALSE, sep = " "))

costsurf <- raster::raster(nrows=dim(dm)[1],ncols=dim(dm)[2],resolution=1,xmn=0,
xmx = dim(dm)[1], ymn = 0, ymx = dim(dm)[2]) #neccessary to set resolution
costsurf[] <- dm

poicoords <- matrix(c(10.5, 10.5), ncol = 2)

result <- irl_acc(dm, poicoords = poicoords, grainprop = 0.25,
costsurf = costsurf, scoord = matrix(c(19.5, 0.5, 11.5, 11.5),
ncol = 2, byrow = TRUE))

result <- irl_acc(dm, poicoords = poicoords, grainprop = 0.25,
costsurf = costsurf, scoord = matrix(c(11.5, 11.5),
ncol = 2, byrow = TRUE))

## End(Not run)

jsta/irlgraph documentation built on May 18, 2017, 10:45 a.m.