PredationMatrix {cheddar}R Documentation

Predation matrix

Description

Returns a predation matrix.

Usage

PredationMatrix(community, weight=NULL)

Arguments

community

an object of class Community.

weight

either the name of a first-class link property or the name of a function that meets the specification of the link.properties parameter of TLPS.

Details

Returns a square matrix with NumberOfNodes rows and columns. If weight is NULL then a binary matrix, in which elements are either 0 or 1, is returned; 1 indicates a trophic link from a resource (row) to a consumer (column). If weight is not NULL then elements of the returned matrix will be set to the values given by weight. Row names and column names of the returned matrix are node names.

Value

A square matrix.

Author(s)

Lawrence Hudson

See Also

PlotPredationMatrix, TLPS, NumberOfNodes, NumberOfTrophicLinks, ResourcesByNode, ConsumersByNode, PredationMatrixToLinks

Examples

data(TL84)

# A square matrix of NumberOfNodes rows and columns
dim(PredationMatrix(TL84))
NumberOfNodes(TL84)

# Should contain NumberOfTrophicLinks links
sum(PredationMatrix(TL84))
NumberOfTrophicLinks(TL84)

# Compare an unweighted matrix and a matrix weighted by diet fraction
data(Benguela)

PredationMatrix(Benguela)
PredationMatrix(Benguela, weight='diet.fraction')

[Package cheddar version 0.1-638 Index]