rand_meta: Random metacommunity matrix.

View source: R/Utility_functions.R

rand_metaR Documentation

Random metacommunity matrix.

Description

Creates a random metacommunity matrix where cell ij is the number of species j in community i.

Usage

rand_meta(N, S, J, min.spec = 2)

Arguments

N

Numeric, the number of communities.

S

Numeric, the number of species.

J

Numeric vector, the number of individuals within each community. If length = 1 gives all communities the same number of individuals.

min.spec

Numeric, the minimum number of species within communities.

Details

This function creates a random metacommunity matrix in which species absolute abundances \(counts\) within communities are recorded.

Value

Returns a numeric matrix where rows are communities, columns are species, and cell ij is the count of species j in community i.

Examples

rand_meta(N = 5, S = 5, J = c(100, 100, 200, 40, 300), min.spec = 2)
rand_meta(N = 5, S = 5, J = 500)

## Not run: 
rand_meta(N = 5, S = 5, J = c(10, 10))

## End(Not run)


trevorjwilli/CommSimABCR documentation built on Feb. 4, 2025, 1:22 a.m.