new.local.demo {rmetasim}R Documentation

Create a Local Demography

Description

Create a local demography for an Rmetasim Landscape object

Usage

  ## must be called AFTER integer, switch, and float params have been created
  ## S, R, and M matricies must be square matricies of size rland$intparam$stages by rland$intparam$stages
  rland <- new.local.demo(rland,S=Smatrix,R=Rmatrix,M=Mmatrix)

Arguments

rland partially created landscape object, required
S Survivablity matrix for demograpy, required
R female Reproduction matrix for demography, required
M Male reporduction matrix for demography, required

Examples

  
  exampleS <- matrix(c(0.1, 0, 0.5, 0.3), nrow = 2)
  exampleR <- matrix(c(0, 1.1, 0, 0), nrow = 2)
  exampleM <- matrix(c(0, 0, 0, 1), nrow = 2)
  
  exampleland <- new.landscape.empty()
  exampleland <- new.intparam.land(exampleland, s=2)
  exampleland <- new.floatparam.land(exampleland)
  exampleland <- new.switchparam.land(exampleland)
  exampleland <- new.local.demo(exampleland,exampleS,exampleR,exampleM)

  exampleland$demography$localdem

  rm(exampleS)
  rm(exampleR)
  rm(exampleM)
  rm(exampleland)

[Package Contents]