Learn R Programming

fossil (version 0.4.0)

sim.occ: Simulated Species Occurrence data

Description

A function to simulate a species occurrence data set

Usage

sim.occ(total.species = 100, endemics = 0.1, regions = 3, locs = 30, avg.abund = 1)

Arguments

total.species

The total number of species in the region (i.e. the number of rows in the result matrix)

endemics

The proportion of endemic species for the entire region

regions

The number of areas of endemicity

locs

The number of samples/locatlities per region of endemicity

avg.abund

The 'average' abundance of a species for any given sample

Value

Returns a matrix of simulated species abundances per locality.

Details

The function creates a matrix of $c$ rows of species (given by total.species) with $n$ number of sample columns (where $n$ equals $regions*locs$). The given abundance of any species at a given sample is determined by a log normal distribution, with each species being randomly assigned a value from rnorm(). The number of endemics for any given region is equal to $total.species*endemics/regions$. An endemic is conseidered to only occur within a given region, and all other non-ndemic species are considered to be 'cosmopolitan' and can occur in any region. The avg.abund value affects how many species are recovered at a given site, and for any given run there are typically species that are not present in the sample but are present in the region.

See Also

ecol.dist

Examples

Run this code
# NOT RUN {
## create a dataset with 2 regions and 5 samples per region
sim.occ(regions=2, locs=5)
# }

Run the code above in your browser using DataLab