Learn R Programming

EcoSimR (version 0.1.0)

size_gamma: SizeGamma Size Overlap Randomization Algorithm

Description

Function to generate a random distribution of body sizes by drawing from a gamma distribution. Shape and rate parameters of the gamma are estimated from the empirical data.

Usage

size_gamma(speciesData = rnorm(50, mean = 100, sd = 1))

Arguments

speciesData
a vector of body sizes or other trait measurements of species. All values must be positive real numbers.

Value

Returns a vector of simulated body sizes as the same length as speciesData.

See Also

fitdistr in the MASS library.

Examples

Run this code
obsOverlap <- size_gamma(speciesData=rnorm(50,mean=100,sd=1))

Run the code above in your browser using DataLab