Learn R Programming

EloRating (version 0.46.11)

randomsequence: random dominance interaction sequence

Description

create a random dominance sequence for testing or simulations

Usage

randomsequence(
  nID = 10,
  avgIA = 20,
  startdate = as.Date("2000-01-01"),
  alphabet = TRUE,
  reversals = 0.1,
  ties = NULL,
  presence = NULL
)

Value

an object of class randomsequence, which is a list with the following items:

seqdat

an interaction sequence

pres

a presence matrix, actually a data.frame

Arguments

nID

integer, number of IDs, must be less than 2601

avgIA

numeric, average number of interactions an individual is involved in

startdate

character, a start date, by default "2000-01-01"

alphabet

logical, should the individual within an interaction that comes first in alphabetical order be the winner? By default TRUE, which gives some orderliness in the hierarchy

reversals

numeric, proportion of interactions that ends in reversed outcomes, i.e. the initial winner (if alphabet=TRUE) the first according to alphanumeric order) is changed into the loser. By default 0.1

ties

numeric, proportion of interactions that ends undecided

presence

numeric vector of length 2. The first value indicates what proportion of individuals are absent for some time. The second value indicates the proportion of time (days) these individuals are absent

Author

Christof Neumann

Examples

Run this code
IA <- randomsequence()
SEQ <- elo.seq(winner = IA$seqdat$winner, loser = IA$seqdat$loser, Date = IA$seqdat$Date,
               runcheck = FALSE, progressbar = FALSE)
stab_elo(SEQ)
#
IA <- randomsequence(presence = c(0.5, 0.5))
SEQ <- elo.seq(winner = IA$seqdat$winner, loser = IA$seqdat$loser, Date = IA$seqdat$Date,
               presence = IA$pres, runcheck = FALSE, progressbar = FALSE)
stab_elo(SEQ)

Run the code above in your browser using DataLab