Ben_sim: Simulation to address Ben Sheldon's comments

Description Usage Arguments Value

View source: R/ben_comment.R

Description

This function will create one possible simulated relationship between sensitivity and exposure

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
Ben_sim(
  interpop_var,
  avg_sensitivity,
  sd_sensitivity,
  resid_sense,
  avg_exposure,
  sd_exposure,
  resid_exp,
  return = "plot"
)

Arguments

interpop_var

The inter-population variation in the error of temperature (basically causes populations to vary in the interannual variability in temp, as Ben suggested)

avg_sensitivity

The beta of sensitivity (laying date ~ temperature)

sd_sensitivity

The sd of the random slope term for laying date ~ temperature across pops

resid_sense

The residual error in sensitivity (laying date ~ temperature)

avg_exposure

The beta of exposure (temperature ~ year)

sd_exposure

The sd of the random slope term for exposure (temperature ~ year) across pops

resid_exp

The residual error in exposure (temperature ~ year)

return

Should the function return a plot ("plot") or the Pearson's correlation of sensitivity and exposure ("cor").

Value

Either a ggplot object ('plot') or numeric value representing the Pearson's correlation between sensitivity and exposure.


LiamDBailey/baileyetal2021 documentation built on Feb. 10, 2022, 12:34 a.m.