census: Extract census data from sim objects

censusR Documentation

Extract census data from sim objects

Description

Returns a summary of census data from a sim object, optionally the raw census, the total abundance of all individuals in each cell, or the species richness in each cell. By default, returns the last snapshot.

Usage

census(sim, snap = length(sim$snaps), type = "census")

Arguments

sim

An object of class sim

snap

Either an integer specifying the index of the snapshot to extract, or the character name of the snapshot. i.e., “500” returns the snapshot corresponding to the 500th timestep (if it exists).

type

One of “census”, “richness”, “abundance”, specifying which summary value is desired.

Details

Pretty much as described above.

Value

For type == “census”, returns a matrix with one row for every grid cell, and one column for every species, with individual matrix element [i,j] containing the abundance of species j in cell i. The census order is the same as the order of the ‘coords’ element in the sim object, for use in rda or variation partitioning.

For type == “abundance”, returns a square matrix of dimension M x M, with each matrix element ij containing the total abundance of individuals in grid cell ij. Suitable for passing to image(), contour() or related functions for display.

For type == “richness”, returns a square matrix of dimension M x M, with each matrix element ij containing the species richness of grid cell ij. Suitable for passing to image(), contour() or related functions for display.

Author(s)

Tyler Smith

See Also

neut.simulate, sim.cut

Examples

## See examples in \code{\link{neut.simulate}}

mcglinnlab/vario documentation built on Feb. 22, 2023, 1:49 p.m.