Description Usage Arguments Value Examples
View source: R/matrix_functions.R
This function converts data in edgelist format to an interaction matrix.
1 | edgelist_to_matrix(edgelist, identities)
|
edgelist |
A two column matrix or dataframe with the identities of winners in the first column and losers in the second column. |
identities |
A list of contestant identities. This list dictates the order in which contestants are arranged in the resulting matrix. |
Produces an interaction matrix with winners in the rows and losers in the columns. Contestants are arranged according to the order specified by identities.
1 2 3 | edges <- C.crocuta.female$interactions[C.crocuta.female$interactions$period == 1989,1:2]
ids <- C.crocuta.female$contestants[C.crocuta.female$contestants$period == 1989,'id']
edgelist_to_matrix(edgelist = edges, identities = ids)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.