commSetup: Setup Model Structure

Description Usage Arguments Value Examples

View source: R/setup.R

Description

This sets up the basic structure of the model. It creates a list of biological parameters in P (S randomized species and their parameters) and it creates a list of environmental parameters in X. All parameters have default values, so input is not necessary.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
commSetup(S = 32, L = 512, W = 8, zo = NULL, gam = NULL,
  sig = NULL, A = NULL, m = 1, gamMean = 2.5, gamSD = 2.5,
  sigMean = 5, sigSD = 5, lam = -2.7, B = 10,
  compType = "lottery", XW = seq(129, 384), temp2d = NULL,
  tempLow = 9.78, tempHigh = 30.22, tempRev = F, tempGH = 1,
  tempGSD = 0, tempLSD = 1, tempGLH = 0.81, tempGLSD = 2,
  tempLSDRed = 0, years = 1000, y = 1, tempY = NULL, tau = 0.04,
  tempYAC = 0.767, tempYSD = 0.1639, Tau = NULL, tempYXGH = 1,
  tempYXGSD = 0, tempYXLSD = 0, tempYXGLH = 1, tempYXGLSD = 0,
  Q = NULL, QMean = 8, QGH = 1, QGSD = 0, QLSD = 0,
  QLType = "none", QLoss = 0)

Arguments

S

Total number of species created with hetSetup.

L

Total number of patches in the metacommunity.

W

Number of microhabitats in each patch.

zo

A vector of pre-defined optimal temperature values. Only works if length(zo) is S.

gam

A vector of pre-defined mean dispersal distances. Only works if length(gam) is S. If no vector is specified, gamMean and gamSD are used to randomly generate the vector gam.

sig

A vector of pre-defined thermal tolerance breadths. Only works if length(sig) is S. If no vector is specified, sigMean and sigSD are used to randomly generate the vector sig.

A

Matrix of the relative competition coefficients between species.

m

A vector of pre-defined mortality probabilities (or a single value that will be shared for all species). These are probabilies, so the value must be between 0 and 1 (inclusive). Only works if length(m) is 1 or S.

gamMean

Mean dispersal distance for randomized species. Default is based on Urban et al. 2012.

gamSD

Standard deviation of dispersal distance for randomized species. Default is based on Urban et al. 2012.

sigMean

Mean thermal tolerance breadth for randomized species. Default is based on Urban et al. 2012.

sigSD

Standard deviation of thermal tolerance breadth for randomized species. Default is based on Urban et al. 2012.

lam

Skewness in thermal tolerance. Default is based on Urban et al. 2012. (to have a mild decrease moving toward colder temperatures and a sharp decrease moving toward warmer temperatures).

B

Area of integrated birth rate over all T for each species.

compType

The type of competition in a string. Must be either "lottery" or "temp"

XW

Window of analysis (to remove edge effects)

temp2d

A matrix of pre-defined temperatures over x. Only works if nrow(temp2d) is L and ncol(temp2d) is W.

tempLow

Lowest mean temperature on linear temperature gradient. temp1d(L)=tempLow

tempHigh

Highest mean temperature on linear temperature gradient. temp1d(1)=tempHigh

tempRev

If tempRev=T, then temp1d(1)=tempLow and temp1d(L)=tempHigh.

tempGH

Hurst exponent for global temperature heterogeneity. H=0.5 is Brownian motion; 0.5<H<=1 is long-term positive autocorrelation and 0<=H<0.5 is long-term negative autocorrelation.

tempGSD

Controls the magnitude of the global temperature heterogeneity.

tempLSD

Standard deviation in temperature between microhabitats in each patch.

years

Maximum number of years for initialization + climate change.

y

Current year.

tempY

A vector of pre-defined temperatures over time. Only works if length(tempY) is years.

tau

Average temperature change per year.

tempYAC

Temperature autocorrelation over time. Default is global temperature AC from 1880-1979.

tempYSD

Temperature standard deviation over time. Default is global temperature SD from 1880-1979.

Tau

Average temperature change per year (in a matrix). If

tempYXGH

Hurst exponent for global heterogeneity in temperature change over time.

tempYXGSD

Magnitude of global heterogeneity in temperature change over time.

tempYXLSD

Standard deviation in temperature change between microhabitats in each patch.

tempYXGLH

Hurst exponent for global heterogeneity in temperature change over time and space.

tempYXGLSD

Standard deviation in temperature change between microhabitats in each patch over space.

Q

A matrix of pre-defined habitat quality over x. Only works if nrow(Q) is L and ncol(Q) is W.

QMean

Average habitat quality for any microhabitat.

QGH

Hurst exponent for global habitat quality heterogeneity. H=0.5 is Brownian motion; 0.5<H<=1 is long-term positive autocorrelation and 0<=H<0.5 is long-term negative autocorrelation.

QGSD

Controls the magnitude of the global habitat quality heterogeneity.

QLSD

Standard deviation in habitat quality between microhabitats in each patch.

QLType

How is the habitat quality lost? Must be "none", "subtract", or "multiplicative".

Value

A list that contains P (a list of biotic paraters) and X (a list of abiotic parameters)

Examples

1
2
3
4
5
6
7
8
cSetup<-commSetup(S=4,L=512,W=4,years=202)
P<-cSetup$P
X<-cSetup$X
n0 <- nSetup(8,4,512,4)
initSim <- commSimulate(n0,P,X,y=1,years=100,init=T)
n1 <- initSim$n
ccSim <- commSimulate(n1,P,X,y=101,years=100,init=F)
vComTime(ccSim$N)

gabackus/rcomms documentation built on Nov. 4, 2019, 1 p.m.