mmmIndex: Create Movement Index Matrix

Description Usage Arguments Value Examples

Description

Create Movement Index Matrix

Usage

1
mmmIndex(n, pattern = NULL, allow = NULL, disallow = NULL)

Arguments

n

integer() Number of areas.

pattern

integer() One of 0: full movement, or 1: direct movement between numerically sequential neighbours only.

allow

integer() matrix() Each row indicates directional movement between a pair of areas indexed from one.

disallow

integer() matrix() As for allow, but specified movement is disallowed.

Value

A square binary matrix with zero diagonal of class mmmIndex

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Neighbours (default)
mmmIndex(6)

# Full movement
mmmIndex(6, 0)

# Neighbours plus 1-6, 2-5, and 5-2, but not 6-1
allow <- matrix(c(1,6,2,5,5,2), ncol = 2, byrow = TRUE)
mmmIndex(6, 1, allow)

# Full minus 1-6
disallow <- matrix(c(1,6), ncol = 2, byrow = TRUE)
mmmIndex(6, 0, disallow = disallow)

luke-a-rogers/mmmTMB documentation built on Jan. 16, 2021, 3:53 p.m.