numInt: Count the number of interactions

Description Usage Arguments Value Examples

Description

Find the number of interactions occuring between two players in an interData object

Usage

1
numInt(p1, p2, intData, includeDraws = F, showInteractions = F)

Arguments

p1

a player in the interData object

p2

a player in the interData object

intData

an object of the class "interData" with players p1 and p2

includeDraws

logical indicating wether to include draws or not

showInteractions

logical indicating wether to return a data frame showing the interactions. Defaults to showing the number of interactions.

Value

Either the number of interactions between p1 and p2 in intData or a dataframe displaying those interactions

Examples

1
2
3
4
5
6
7
8
9
# generate generic data
interactions <- data.frame (a = sample (letters [1:10], 100, T),
                            b = sample (letters [1:10], 100, T),
                            o = sample (c(-1,-1,0,1,1), 100, T),
                            d = Sys.time () + runif (100, 40, 160))
# convert to interData object
id1 <- intTableConv (interactions)
# calculate using all players
numInt (id1$players [1], id1$players [2], id1)

nmmarquez/linHierarchy documentation built on May 23, 2019, 9:28 p.m.