Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lambda table (closes #25) #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions R/make_lambda_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@
#' det_ff = ipm_det_ff,
#' det_cf = ipm_det_cf,
#' stoch_ff = ipm_stoch_ff,
#' stoch_cf = ipm_stoch_cf
#' stoch_cf = ipm_stoch_cf,
#' dlnm_ff = ipm_dlnm_ff,
#' dlnm_cf = ipm_dlnm_cf
#' )
#'
#' #bt_list should look like this:
#' bt_list <- list(
#' det_ff = lambda_bt_det_ff,
#' det_cf = lambda_bt_det_cf,
#' stoch_ff = lambda_bt_stoch_ff,
#' stoch_cf = lambda_bt_stoch_cf
#' # dlnm_ff = lambda_bt_dlnm_ff,
#' # dlnm_cf = lambda_bt_dlnm_cf
#' stoch_cf = lambda_bt_stoch_cf,
#' dlnm_ff = lambda_bt_dlnm_ff,
#' dlnm_cf = lambda_bt_dlnm_cf
#' )
#'
#' #load the above targets with tar_load(starts_with("lambda")) and
#' tar_load(starts_with("ipm"))
#'
#' make_lambda_table(ipm_list, bt_list, alpha = 0.05)
make_lambda_table <- function(ipm_list, bt_list, alpha = 0.05) {

Expand Down
13 changes: 8 additions & 5 deletions docs/paper.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,20 @@ lambda_table %>%
c(
"det" = "Deterministic",
"stoch" = "Stochastic, kernel-resampled",
"DLNM" = "Stochastic, parameter-resampled"
"dlnm" = "Stochastic, DLNM"
)
)) %>%
select(IPM = ipm, Habitat = habitat, "$\\lambda$" = lambda) %>%
select(IPM = ipm, habitat, lambda) %>%
pivot_wider(names_from = "habitat", values_from = lambda) %>%

pandoc.table(
digits = 5,
keep.trailing.zeros = TRUE,
justify = c("left", "left", "right"),
justify = c("left", "right", "right"),
full_width = FALSE,
caption = "(\\#tab:lambdas) Population growth rates for continuous forest (CF) and forest fragments (FF) under different kinds of IPMs with bootstrapped, bias-corrected, 95% confidence intervals."
caption = "(\\#tab:lambdas) Population growth rates (lambda) for continuous forest (CF) and forest fragments (FF) under different kinds of IPMs with bootstrapped, bias-corrected, 95% confidence intervals."
)

#TODO: in caption possibly explain that lambdas are calculated differently for deterministic and stochastic models
```

# Figures
Expand All @@ -360,6 +362,7 @@ knitr::include_graphics(path, rel_path = FALSE)
```{r pop-states}
#| fig.cap = "Relative proportions of plant sizes in the first 250 iterations of the IPM simulations. Stacked area charts (A) show the relative size/stage distribution of plants in continuous forest (CF, top row) and forest fragments (FF, bottom row) in each of the three IPMs (columns). The proportion of each size class in CF and FF for each iteration is shown in B with the first 30 iterations removed to not include transient dynamics. A 1:1 line is plotted in black. Size categories include seedlings (a discrete category in the IPMs), pre-reproductive 1 (log(size) 0–2.5) that have low average survival (< 0.9) and a near 0 probability of flowering, pre-reproductive 2 (log(size) 2.5–4.5) that have a higher average survival probabilty (> 0.8) and a near 0 probability of flowering, reproductive 1 (log(size) 4.5–6) that have a high average survival probability (>0.95) and a lower flowering probability (< 0.25), and reproductive 2 (log(size) 6+) that have a high average survival probability (>0.95) and higher flowering proability (> 0.2)."


knitr::include_graphics(here(fig_pop_states), rel_path = FALSE)

```
Expand Down
50 changes: 26 additions & 24 deletions docs/paper.html

Large diffs are not rendered by default.