edgelist_to_matrix {DynaRankR}R Documentation

Convert data from edgelist to interaction matrix

Description

This function converts data in edgelist format to an interaction matrix.

Usage

edgelist_to_matrix(edgelist, identities)

Arguments

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.

Value

Produces an interaction matrix with winners in the rows and losers in the columns. Contestants are arranged according to the order specified by identities.

Examples

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)



[Package DynaRankR version 1.1.0 Index]