prob_successful_migration: For cells at the boundary of a population, find mean...

Description Usage Arguments Value Examples

View source: R/demonanalysis.R

Description

For cells at the boundary of a population, find mean proportion of nearest neighbour sites that are empty

Usage

1

Arguments

mat

matrix in which empty sites are denoted NA

Value

a vector containing total number of empty neighbours, total number of edge cells, and average proportion of empty neighbours per edge cell

Examples

1
2
3
4
5
6
7
8
9
mat <- image_df_from_grid_file(system.file("extdata", 
"output_popgrid.dat", package = "demonanalysis", mustWork = TRUE), as_matrix = TRUE)
prob_successful_migration(mat)

# Note that the edge of the grid counts as empty space:
mat <- matrix(c(NA,NA,NA,NA,
1,1,1,1,
NA,NA,NA,NA), nrow = 3, byrow = TRUE)
prob_successful_migration(mat)

robjohnnoble/demonanalysis documentation built on June 30, 2020, 12:47 a.m.