warnWarners: Warning Other Warners

Description Usage Arguments Value Examples

View source: R/attack.R

Description

Example of an alternative function to govern behavior of warners under attack. User must set values of number_warned and dominant. Warner warns a specified number of the most closely-related individuals. Warners only warn other warners.

Usage

1
2
warnWarners(individuals, number_warned, warner_death_prob, nonwarner_death_prob,
  hider_death_prob, dominant)

Arguments

individuals

Data frame containing id, sex, warner-status, mother id and father id.Value provided.

number_warned

Maximum number of individuals to warn.

warner_death_prob

As in simulate. Value provided.

nonwarner_death_prob

As in simulate. Value provided.

hider_death_prob

As in simulate. Value provided.

dominant

If TRUE, individuals with 1 or more altruistic alleles can warn.

Value

A numerical vector of death probabilities in which the i^{\text{th}} element corresponds to row i of individuals.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
pop <- simulate(sim_gens = 200,
                attack_behavior = list(
                  fn = warnWarners,
                  args = list(
                    number_warned = 7,
                    dominant = TRUE)))

## End(Not run)

homerhanumat/simaltruist documentation built on May 25, 2019, 5:26 p.m.