traj_elo: calculate dominance trajectory

Description Usage Arguments Value Author(s) Examples

View source: R/traj_elo.r

Description

calculate individual Elo rating trajectory over time

Usage

1
2
3
4
5
6
traj_elo(
  eloobject,
  ID,
  from = min(eloobject$stability$date),
  to = max(eloobject$stability$date)
)

Arguments

eloobject

result from elo.seq

ID

character, the ID(s) of the individual(s)

from

character, from which date onwards should the trajectory be calculated. By default the first date in the sequence is used

to

character, until which date should the trajectory be calculated. By default the last date in the sequence is used

Value

A data.frame with as many lines as specified in ID, columns for ID, date range, the actual slope (trajectory), and the number of observed interactions within the date range

Author(s)

Christof Neumann

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(adv)
SEQ <- elo.seq(winner = adv$winner, loser = adv$loser, Date = adv$Date)
traj_elo(SEQ, "a")

traj_elo(SEQ, "a", from = "2010-01-20", to = "2010-01-30")

# no slope available if ID was not observed interacting
# inside the date range
traj_elo(SEQ, "a", from = "2010-01-17", to = "2010-01-18")

# no slope available if ID was only observed interacting
# once within the date range
traj_elo(SEQ, "a", from = "2010-01-17", to = "2010-01-19")

# for several individuals
traj_elo(SEQ, c("a", "b", "c"))

EloRating documentation built on March 26, 2020, 7:29 p.m.