winStreak: Find win streak of players in group

Description Usage Arguments Details Value Examples

Description

Given an interData object returns the longest win streaks for each player.

Usage

1
winStreak(intData, players = intData$players, sList = FALSE)

Arguments

intData

an object of class "interData" from which wins are evaluated.

players

teh players to get winstreaks of.

sList

logical indicating wether a detailed list should be returned indicating player records and winstreaks. Default is FALSE.

Details

The function will return a dataframe with specified players from the interData object along with their longest win streak and the dates of the first and last victory.

Value

data frame detailing the winstreaks of the specified players.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)
# get the winstreaks of players
winStreak (id1)
# with details
winStreak (id1, sList = TRUE)

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