rawspread: Function to calculate a resistant spread out from a focal...

View source: R/rawspread.R

rawspreadR Documentation

Function to calculate a resistant spread out from a focal cell of a matrix.

Description

This function takes a spread value, the focal cell coordinates, and a resistance matrix (all values >= 1); executes a resistant spread; and returns the final snapshot of the spread as a matrix.

Usage

rawspread(x, spread.value, row, col, square=FALSE)

Arguments

x

the resistance matrix, all values must be >= 1

spread.value

the initial bank account for the spread, which is depleted based on the resistance of each cell as the spread progresses.

row

the focal row of the spread

col

the focal column of the spread

square

if TRUE then the diagonal cells will be considered to be one cell length away from the center and the spread will tend to be square. The default of FALSE uses a diagonal length of 1.4 cells and spreads tend to be octagonal.

Details

This calculates the functional proximity of each cell to the focal cell. With the proximity highest at the focal cell where it is equal to the spread.value and diminishing with distance from the focal cell (based on the resistance of intervening cells). The functional proximity thus is zero for cells with a functional distance greater than spread.value from the focal cell (regardless of how much greater). In practice larger spread values allow calculation of larger functional distances but requires more processor time.

To convert the returned matrix of proximity value to a least cost distances subtract the matrix from spread.value. However, this will only calculate least cost distance correctly for cells that are within of spread.value of the focal cell; all other cells would end up with spread.value despite being farther away.

Value

A matrix with the same dimensions as x the values of which represent the functional proximity to the focal cell. They range from spread.value (at the focal cell) to zero for cells greater than spread.value away from the focal cell.

Author(s)

Ethan Plunkett, Brad Compton, and Eduard Ene

References

Compton, B.W., K. McGarigal, S.A. Cushman, and L.R. Gamble. 2007. A resistant-kernel model of connectivity for amphibians that breed in vernal pools. Conservation Biology 21:788-799. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.1523-1739.2007.00674.x")}

McGarigal, K., B.W. Compton, E.B. Plunkett, W.V. DeLuca, J. Grand, E. Ene, and S.D. Jackson. 2018. A landscape index of ecological integrity to inform landscape conservation. Landscape Ecology 33:1029-1048. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10980-018-0653-9")}

See Also

spread

Examples

# Create (minimally resistant) test matrix
a <- matrix(1, 5, 5)
a
rawspread(a, 10, 3, 3)

# Add two higher resistance bands
a[2, ]  <- 5
a[,2] <- 5
a
rawspread(a, 10, 3, 3)


ethanplunkett/gridprocess documentation built on Feb. 1, 2024, 2:24 a.m.