randomsequence: random dominance interaction sequence

View source: R/randomsequence.R

randomsequenceR Documentation

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
)

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

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

Author(s)

Christof Neumann

Examples

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)


gobbios/EloRating documentation built on July 19, 2024, 4:05 a.m.