# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Perform a stage-based demographic transition
#'
#' @param N A 3-D array of population numbers for each life stage, over a spatial grid (x, y, class).
#' @param E A 3-D array of environmental data (x, y, variable).
#' @param alpha A matrix of transition intercepts (to, from).
#' @param beta A 3-D array of density dependence effects (to, from, modifier).
#' @param gamma A 3-D array of environmental effects (to, from, variable).
#' @param rand Randomize transitions instead of using matrix multiplication? (Boolean, default = TRUE).
#' @param seed Integer to seed random number generator.
#' @return A 3-D array of population numbers for each life stage.
#' @export
transition <- function(N, E, alpha, beta, gamma, rand = TRUE, seed = 1L) {
.Call(`_deranged_transition`, N, E, alpha, beta, gamma, rand, seed)
}
#' Reproduction across a spatial grid
#'
#' @param N A 3-D array of population numbers for each life stage, over a spatial grid (x, y, class).
#' @param f Integer vector of fecundity with a value for each class in \code{N}.
#' @return A matrix.
#' @export
reproduce <- function(N, f) {
.Call(`_deranged_reproduce`, N, f)
}
#' Simulate dispersal across a spatial grid
#'
#' @param S A matrix of seed counts across a spatial grid.
#' @param N A neighbor matrix, e.g. produced by \code{neighborhood()}.
#' @param reflect Should dispersers exit the domain (\code{FALSE}) or bounce off the domain boundary (\code{TRUE}, default)?
#' @param rand Randomize dispersal? (default = \code{TRUE})
#' @param seed Integer to seed random number generator.
#' @return A matrix of post-dispersal seed counts of the same dimension as \code{S}.
#' @export
disperse <- function(S, N, reflect = TRUE, rand = TRUE, seed = 1L) {
.Call(`_deranged_disperse`, S, N, reflect, rand, seed)
}
#' Run a range simulation
#'
#' @param N A 3-D array of population numbers for each life stage, over a spatial grid (x, y, class).
#' @param env A list of environmental data. Each element list element should be a 3-D array of dimensions (x, y, variable).
#' The list should have one element for time-invariant environment, or \code{nsteps} elements for time-varying environment.
#' @param alpha, \code{beta, gamma, fecundity} Demographic parameters; see \code{?transition} and \code{?reproduce}.
#' @param nb Neighborhood matrix; e.g. output from \code{neighborhood}.
#' @param rand Randomize transitions instead of using matrix multiplication? (Boolean, default = TRUE).
#' @param seed Integer to seed random number generator.
#' @return A 3-D array of population numbers for each life stage.
#' @export
sim <- function(N, env, alpha, beta, gamma, fecundity, nb, reflect = TRUE, rand = TRUE, seed = 1L, record = 0L, nsteps = 100L) {
.Call(`_deranged_sim`, N, env, alpha, beta, gamma, fecundity, nb, reflect, rand, seed, record, nsteps)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.