Learn R Programming

IPMpack (version 1.6)

simulateCarlina: Generates random data in the form used by IPMpack based on the population dynamics of Carlina vulgaris

Description

Simulates growth, survival and fecundity and density dependent seedling establishment to create a dataframe of the form required by the functions and methods used in IPMpack. Demographic stage data is only continuous. Note that the number or rows corresponding to each year of the data-frame does not inform about population size, since rows exist that correspond to offspring appearing in the subsequent year.

Usage

simulateCarlina(nSamp=2000,nYrs=1000,nSampleYrs=15,
		m0=-1.37,ms=0.59,
		b0=-12.05,bs=3.64,
		A=-1,B=2,
		ag=1.13,bg=0.74,sig=sqrt(0.095),
		mean.kids=3.0,sd.kids=0.52,
		meanYear=c(0,0,0),
		matVarYear=matrix(c(1.34,0.1,0,0.1,0.04,0,0,0,0.01),3,3),densDep=TRUE,maxPop=1e7,
		sizes = c())

Arguments

nSamp
number of samples desired in the base population, defaults to 2000
nYrs
number of years in the simulation, defaults to 1000
nSampleYrs
number of years sampled, defaults to 15
m0
intercept survival
ms
slope survival
b0
intercept flowering
bs
slope flowering
A
intercept reproductive allometry seed production
B
slope reproductive allometry seed production
ag
intercept growth
bg
slope growth
sig
variance growth
mean.kids
mean kid size
sd.kids
variance kid size
meanYear
mean year effects
matVarYear
var-covariance in year effects
densDep
density dependence in seedling establishment or not?
maxPop
maxPop no measurements recorded at which to stop iterating - i.e. break the loop and return data up to that year
sizes
starting sizes in the population (optional)

Value

  • A list including: dataf: A dataframe with headings: - "size": continuous variable, indicating current size. - "sizeNext" continuous variable, indicating size in the next time step. - "surv": boolean, indicating whether individual survived or not to the next time step. - "covariate": discrete covariate. - "covariateNext": discrete covariate in the next time step. - "fec": continuous variable, indicating fecundity. - nSeedlings: number seedlings corresponding to that year - m.year: intercept of mortality for that year - cg.year: intercept of growth for that year - b.year: intercept of offspring size for that year - offspringNext: where the row corresponds to offspring, this takes the value offspringNexxt - year: year of the sample listpar: - a list of all the other parameters

See Also

generateDataStoch,generateDataDiscrete

Examples

Run this code
#Uncomment to run
#dff <- simulateCarlina(nSamp=1000)
#head(dff$dataf)

Run the code above in your browser using DataLab