samc | R Documentation |
Implements the SAMC algorithm from samc.
samc( resistance, absorption = NULL, fidelity = NULL, directions = 8, kernel = NULL, resistance_na_mask = 0, absorption_na_mask = 0, fidelity_na_mask = 0, symmetric = TRUE ) distribution(samc, occ, time = 1, dead = NULL)
absorption |
A |
fidelity |
A |
directions |
Either 4 (rook) or 8 (queen), the directions of movement. |
kernel |
Alternative to "directions", a square kernel. |
resistance_na_mask |
Default to 0, the value to give to NAs and NaNs values in resistance. |
absorption_na_mask |
Default to 0, the value to give to NAs and NaNs values in absorption. |
fidelity_na_mask |
Default to 0, the value to give to NAs and NaNs values in fidelity. |
symmetric |
Default to true, whether movement is symmetrical between cells. |
samc |
A list resulting from calling samc. |
occ |
The initial state of the model (abundance matrix). |
time |
A positive integer or a vector of positive integers representing time steps. |
dead |
Optionnal matrix containing information on deaths. |
samc
will return a list.
distribution
will also return a list.
library(raster) res <- LSTDConnect::ghm occ <- 101 - res high_mort <- 0.25 low_mort <- 0.01 cutoff <- 80 mort <- res mort[mort >= cutoff] <- high_mort mort[mort < cutoff] <- low_mort samc_cache <- LSTDConnect::samc(resistance = res, absorption = mort, directions = 4) dists <- LSTDConnect::distribution(samc = samc_cache, occ = occ, time = 1000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.