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

View source: R/community_trophic_links.R

Returns a predation matrix.

1 | ```
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`

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')
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.