RecordToArray | R Documentation |
This function converts records for the occurrence of interactions registered in 'long' format, with columns for consumer, resource, location and frequency into an interaction array.
RecordToArray(data, cons = 1, res = 2, loc, freq = NULL)
data |
A dataframe of recorded interactions. It needs at least one column for consumer identity and another for resource identity. If the study spans different locations, one column with location identity must be provided. The frequency of a given interaction is recorded in a separate column or as different records. |
cons , res |
Consumer and resource column identity. Can be provided as the column number or name. If those are not provided, it is assumed that consumers are in the first column and resources in the second |
loc |
Location column identity, also column number or name. If not provided, a warning is given and it is assumed that interactions occur in a single location |
freq |
Interaction frequency column identity, also column number or name. If the frequency of a given interaction is recorded as a separate column instead of being placed as different records in the dataframe, this information must be provided. |
An object of class interaction array. To calculate DSI, resource names must match the phylogeny tip labels and resource availability names.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.