View source: R/community_trophic_links.R
| PredationMatrix | R Documentation |
Returns a predation matrix.
PredationMatrix(community, weight=NULL)
community |
an object of class |
weight |
either the name of a first-class link property or the name of
a function that meets the specification of the |
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.
A square matrix.
Lawrence Hudson
PlotPredationMatrix,
TLPS,
NumberOfNodes,
NumberOfTrophicLinks,
ResourcesByNode,
ConsumersByNode,
PredationMatrixToLinks
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.