generateData: Generates random data in the form used by IPMpack.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/IPMpack-Util.r

Description

Simulates growth, survival and fecundity to create a dataframe of the form required by the functions and methods used in IPMpack. Demographic stage data is only continuous.

Usage

1
generateData(nSamp=1000, type="simple")

Arguments

nSamp

number of samples desired in the base population, defaults to 1000

type

the kind of simulated data required. Supported values include "simple" (which includes only a continuous stage and a discretely varying covariate); "discrete" (which includes a discretely varying life stage); and "stochastic" (which includes stochastically varying covariates)

Value

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 (for type="simple"). - "covariateNext": discrete covariate in the next (for type="simple") time step. - "covariate1", "covariate2", "covariate3", ...: discrete or continuous covariates (for type="stochastic".

- "fec": continuous variable, indicating fecundity. - "stage": character vector, containing names of the discrete stages in that time-step, or "continuous" (for type="discrete"). - "stageNext": character vector, containing names of the "discrete" stages in the following time-step, or "continuous" size value (for type="discrete"). - "number": number of individuals moving between stages. "number" = 1 for all movements out of the "continuous" stage; "number" > 1 for all movements out of "discrete" stages. This allows the user to not need to have an individual line for every movement between discrete stages (for type="discrete").

Author(s)

C. Jessica E. Metcalf, Sean M. McMahon, Roberto Salguero-Gomez, Eelke Jongejans & Cory Merow.

See Also

simulateCarlina

Examples

1
2
3
4
5
6
7
8
dff <- generateData(nSamp=2000, type="simple")
head(dff)

dff <- generateData(nSamp=2000, type="discrete")
head(dff)

dff <- generateData(nSamp=2000, type="stochastic")
head(dff)

IPMpack documentation built on May 29, 2017, 3:45 p.m.