randomsequence: random dominance interaction sequence

Description Usage Arguments Value Author(s) Examples

View source: R/randomsequence.R

Description

create a random dominance sequence for testing or simulations

Usage

1
2
3
4
5
6
7
8
9
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

1
2
3
4
5
6
7
8
9
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)

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