knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Introduction

Figure 28.5 investigates how changes in the male dominance parameter (gamma) impacts the sex ratio in the context of three scenarios

  1. A winter limited population (K.bc = 800 pair, K.wg = 485 individuals)
  2. A breeding season (summer) limited population (K.bc = 205, K.wg = 580)
  3. An intermediate scenario (K.bc = 205, K.wg = 900)

Making Figure 28.5 the easy way

Load the package

library(redstart)

There param_ranges() function has a "figure = ..." arguement and also a "scenario = ...".

The intial range of the parameters are made by setting "figure = 28.5" and "scenario" to "winter", "summer", or "int". This sets the fixed parameters for each value and the min of gamma to 1 and the max of gamma to 5.

F28.5.range.winter <- param_ranges(figure = 28.5, scenario = "winter")
F28.5.range.summer <- param_ranges(figure = 28.5, scenario = "summer")
F28.5.range.inter  <- param_ranges(figure = 28.5, scenario = "int")

This code makes a dataframe which summaries these parameters.

data.frame(winter = head(F28.5.range.winter),
           int    = head(F28.5.range.inter),
           summer = head(F28.5.range.summer))

param_seqs() generates values between the minimum and the maxium.

F28.5.win.seq <- param_seqs(F28.5.range.winter)
F28.5.int.seq <- param_seqs(F28.5.range.inter)
F28.5.sum.seq <- param_seqs(F28.5.range.summer,len.out= 20)

For Figure 28.5 only the breeding ground carrying capacity is varied.

head(F28.5.win.seq,3)

All combinations of parameters are created using param_grid()

F28.5.win.grid <- param_grid(param.seqs = F28.5.win.seq)
F28.5.int.grid <- param_grid(param.seqs = F28.5.int.seq)
F28.5.sum.grid <- param_grid(param.seqs = F28.5.sum.seq)

Finally runFAC_multi() is called for each scenario's grid.

F28.5.FAC.win <- runFAC_multi(param.grid = F28.5.win.grid)
F28.5.FAC.int <- runFAC_multi(param.grid = F28.5.int.grid)
F28.5.FAC.sum <- runFAC_multi(param.grid = F28.5.sum.grid)

Once all calls to runFAC_mulit() are done we can plot using plot_Fig28_5().

plot_Fig28_5(dat.winter.lim = F28.5.FAC.win$multiFAC.out.df.RM,
             dat.intermediate = F28.5.FAC.int$multiFAC.out.df.RM,
             dat.summer.lim = F28.5.FAC.sum$multiFAC.out.df.RM,
             drain = T)

Make Figure 28.5: Step-by-step instructions

Vary gamma by

Comparing output of redstart to the original



brouwern/FACavian documentation built on March 23, 2022, 10:07 a.m.