irl_graph: Generate an irregular landscape graph

Description Usage Arguments Examples

View source: R/irl_graph.R

Description

Subset the nodes in a matrix of cost values based on user defined point-of-interest coordinates, a user-defined importance cutoff, and a randomly selected proportion of non-null cells. Generate a graph object from this subset using delaunay triangulation.

Usage

1
2
irl_graph(dm, poicoords = NA, grainprop = 0.25, cutoff = 0,
  irregular = TRUE)

Arguments

dm

matrix of 2d cost values

poicoords

matrix 2 column point-of-interest coordinates

grainprop

numeric proportion of cells selected as grain cells

cutoff

numeric user-defined importance cutoff

irregular

logical skip irregular node subsetting routine?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 

dm <- matrix(
c(1,  1,  1,  1,  1,
 NA, NA, NA, NA, 1, 
 1,  1,  1,  1,  1,
 1,  1,  1,  1,  1,
 1,  1,  1,  1,  1
 ), ncol = 5, byrow = TRUE)
 
sp::plot(raster::raster(dm))
raster::text(raster::raster(dm), which(raster::raster(dm)[] == 1))

graph <- irl_graph(dm)
plot(graph$graph)
geometry::trimesh(graph$tri$tri, graph$allcoords)

## End(Not run)

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