create_movement_index: Create A Movement Index Matrix

create_movement_indexR Documentation

Create A Movement Index Matrix

Description

Create A Movement Index Matrix

Usage

create_movement_index(
  number_of_regions,
  movement_pattern = 2,
  movement_allow = NULL,
  movement_disallow = NULL
)

Arguments

number_of_regions

integer() Number of regions

movement_pattern

integer() One of 1: movement between all pairs of regions at each step, or 2: movement between numerically sequential regions (the default)

movement_allow

integer() matrix() Adjusts the movement pattern to allow additional movement between regions. Each row indicates directional movement between a pair of regions

movement_disallow

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

Value

A square matrix of zeros and ones

Examples


# Neighbors (default)
create_movement_index(6)

# All pairwise movement
create_movement_index(6, 1)

# Neighbors plus 1-6, 2-5, and 5-2, but not 6-1
movement_allow <- matrix(c(1,6,2,5,5,2), ncol = 2, byrow = TRUE)
create_movement_index(6, 2, movement_allow)

# All pairwise movement but not 1-6
movement_disallow <- matrix(c(1,6), ncol = 2, byrow = TRUE)
create_movement_index(6, 1, movement_disallow = movement_disallow)


luke-a-rogers/mmmstan documentation built on Aug. 9, 2024, 3:13 a.m.