PredationMatrix: Predation matrix

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/community_trophic_links.R

Description

Returns a predation matrix.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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')

cheddar documentation built on June 10, 2018, 9:03 a.m.