Supplement 1. R Scripting Language code used for data generation in simulations.

File List



datgen_defs.r: This file contains the following functions:

  1. xgen() Generates random environmental values given a distribution ID and sample size.
  2. mugen() Generates mean values for a negative binomial distribution over a given environmental gradient.
  3. ygen() Generates random count data given an environmental gradient, distribution mean, and CV.

datgen_script.r: This file generates random datasets as they were in this study.

wedge.r: This file contains the following functions:

  1. rwedge() Takes random draws from a wedge-shaped pdf.
  2. dwedge() Reports the cdf from a wedge-shaped distribution given a quantile. This zip file contains all the above files.