expand: expand

Description Usage Arguments Details Value

View source: R/landscape.R

Description

cellular automata-like function to "grow" habitat patches

Usage

1
expand(x, n.size, start)

Arguments

x

A matrix whose cell values all = 1

n.size

A number representing the target size for each cluster

start

A number between 1 and the number of cells in matrx x indicating the algorithm starting position.

Details

Function to expand a patch randomly within indicator array x (wherein 1=unoccupied) by n.size cells, beginning at index start. Algorithm based on and modified from: https://gis.stackexchange.com/questions/60562/creating-randomly-shaped-clumps-of- cells-in-a-raster-from-seeds-of-1-cell-pixel

Value

A a grid of generated numbers of approximately n.size


syanco/checkyourself documentation built on Jan. 18, 2021, 4:50 a.m.