TrophicChainsStats: Trophic chains statistics

View source: R/chains.R

TrophicChainsStatsR Documentation

Trophic chains statistics

Description

Computes simple statistics about every trophic chain in a food web.

Usage

TrophicChainsStats(community)

Arguments

community

an object of class Community.

Details

Enumerates every trophic chain in the food-web and returns a list object containing some simple statistics. If your analysis requires only simple statistics about trophic chains then this function is more suitable than TrophicChains because it is faster and requires less memory.

Value

A list containing:

chain.lengths

The number of nodes in each trophic chain.

node.pos.counts

A matrix of NumberOfNodes rows and 1+max(chain.lengths) columns. Elements are the number of chains in which a node appear in that position.

Author(s)

Lawrence Hudson

See Also

TrophicChains, NumberOfNodes, IsolatedNodes, BasalNodes, IntermediateNodes, TopLevelNodes

Examples

data(TL84)
chain.stats <- TrophicChainsStats(TL84)

# The length of every chain
length(chain.stats$chain.lengths)    # 5,988 chains
summary(chain.stats$chain.lengths)

# The number of chains in which a node appears in that position in a chain
chain.stats$node.pos.counts

# Basal nodes only have counts in the first column.
chain.stats$node.pos.counts[BasalNodes(TL84),]

# Consumers only have counts in columns two and up.
chain.stats$node.pos.counts[c(IntermediateNodes(TL84),TopLevelNodes(TL84)),]

# All counts are zero for isolated nodes IsolatedNodes.
chain.stats$node.pos.counts[IsolatedNodes(TL84),]

cheddar documentation built on Sept. 1, 2022, 5:06 p.m.