mapping: Create vector maps for cellular automata updating.

Description Usage Arguments Details Value

View source: R/caspr.R

Description

Create vector maps for cellular automata updating.

Usage

1
2
mapping(width, height = width, boundary = "periodic",
  i_matrix = matrix(c(0, 1, 0, 1, NA, 1, 0, 1, 0), ncol = 3, byrow = TRUE))

Arguments

width

An integer number giving the width of the landscape or a landscape object.

height

An integer number. The height of the landscape. Defaults to value given in width.

boundary

A character value representing the type of boundary conditions. Defaults to "periodic". No other boundaries implemented, yet.

i_matrix

A matrix defining the interaction matrix to be evaluated. Defaults to 4-cell neighborhood.

Details

This function and the objects generated by it are necessary for the function neighbors to vectorise the calculation of neighbors. The interaction matrix can be flexibly defined as a matrix that has precisely one cell with value NA, marking the focal cell. Any number larger than 0 marks a cell that is to be taken into account for counting.

Value

Creates a map of the landscape object to translate it into a vector with boundaries (x_with_border) and another one to back-translate it to a vector without boundaries (x_to_evaluate) into the global environment. This will automatically be called within ca().


caspr documentation built on May 2, 2019, 5:25 p.m.