Last updated: 2021-11-19
Checks: 7 0
Knit directory: SaniVult/
This reproducible R Markdown analysis was created with workflowr (version 1.6.2). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(666)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 914db7f. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Untracked files:
Untracked: README.html
Untracked: code/utilities.R
Unstaged changes:
Modified: README.md
Modified: code/S4D3M_JAGS_Fitting.R
Deleted: code/utilities.r
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were made to the R Markdown (analysis/index.Rmd
) and HTML (docs/index.html
) files. If you’ve configured a remote Git repository (see ?wflow_git_remote
), click on the hyperlinks in the table below to view the files as they were in that past version.
File | Version | Author | Date | Message |
---|---|---|---|---|
Rmd | 914db7f | Pablo Almaraz | 2021-11-19 | Publish |
html | aad1daf | Pablo Almaraz | 2021-11-19 | Build site. |
Rmd | 073c12d | Pablo Almaraz | 2021-11-19 | Publish |
Rmd | 6d825ea | Pablo Almaraz | 2021-11-19 | Nearly there |
html | 6d825ea | Pablo Almaraz | 2021-11-19 | Nearly there |
Rmd | 43d2ace | Pablo Almaraz | 2021-11-18 | Update |
html | 43d2ace | Pablo Almaraz | 2021-11-18 | Update |
html | b597ece | Pablo Almaraz | 2021-11-17 | wflow_git_commit(all = T) |
html | 786d58c | Pablo Almaraz | 2021-11-17 | Build site. |
Rmd | 9a35b18 | Pablo Almaraz | 2021-11-17 | Start workflowr project. |
Please look the README
file for further details on reproducing the results of this project. Note that the following chunks are supposed to run sequentially.
Check that the pacman package is installed. Alternatively, note that you can use the checkpoint package to build an environment identical to the date of completion of the present project. Look at the Session information
tab below. After pacman is installed, the p_load
function will check that the selected packages are installed. If they are, it will load them; if not, it will first install them and then load them.
# if (!require(checkpoint)) install.packages('checkpoint')
# checkpoint::checkpoint("2021-11-18")
if (!require(pacman)) install.packages('pacman')
Loading required package: pacman
pacman::p_load(tidyverse,runjags,coda,ggmcmc,xtable,data.table,viridis,ggsci,patchwork,mvtnorm,truncnorm,grateful)
source("code/utilities.R")
This will run the analyses in an order temporal sequence.
# All periods ####
for(TimePeriod in c("PreBSE","BSE","PostBSE")){
# Loada data: ####
load_data(TimePeriod)
# Find the equilibrium population and the variance of state variables: ####
find_equilibrium_population(TimePeriod,
adapt = 10000,
burnin = 100000,
sample = 1000,
thin = 100)
# Fit the SSSSDDDM: ####
fit_S4D3M(TimePeriod,
n.chains = 3,
adapt = 10000,
burnin = 500000,
sample = 1000,
thin = 500,
mcmc_diagnostics_plots = TRUE,
PPC_simulations = TRUE,
N_PPC_Fits = 100,
burnin_ppc = 100000,
sample_ppc = 1000,
thin_ppc = 100)
}
The call to this function will produce all the figures in the paper
Figures()
Once the analyses are completed and the figures produced, this shell call to the Makefile
will compile and open the manuscript and related supplementary material:
make compile
sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3
locale:
[1] LC_CTYPE=es_ES.UTF-8 LC_NUMERIC=C
[3] LC_TIME=es_ES.UTF-8 LC_COLLATE=es_ES.UTF-8
[5] LC_MONETARY=es_ES.UTF-8 LC_MESSAGES=es_ES.UTF-8
[7] LC_PAPER=es_ES.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] grateful_0.0.3 truncnorm_1.0-8 mvtnorm_1.1-3 patchwork_1.1.1
[5] ggsci_2.9 viridis_0.6.2 viridisLite_0.4.0 data.table_1.14.2
[9] xtable_1.8-4 ggmcmc_1.5.1.1 coda_0.19-4 runjags_2.2.0-3
[13] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4
[17] readr_2.1.0 tidyr_1.1.4 tibble_3.1.6 ggplot2_3.3.5
[21] tidyverse_1.3.1 pacman_0.5.1 workflowr_1.6.2
loaded via a namespace (and not attached):
[1] httr_1.4.2 sass_0.4.0 jsonlite_1.7.2 modelr_0.1.8
[5] bslib_0.3.1 assertthat_0.2.1 cellranger_1.1.0 yaml_2.2.1
[9] pillar_1.6.4 backports_1.3.0 lattice_0.20-45 glue_1.5.0
[13] digest_0.6.28 RColorBrewer_1.1-2 promises_1.2.0.1 rvest_1.0.2
[17] colorspace_2.0-2 htmltools_0.5.2 httpuv_1.6.3 plyr_1.8.6
[21] pkgconfig_2.0.3 broom_0.7.10 haven_2.4.3 scales_1.1.1
[25] whisker_0.4 later_1.3.0 tzdb_0.2.0 git2r_0.28.0
[29] generics_0.1.1 ellipsis_0.3.2 withr_2.4.2 cli_3.1.0
[33] magrittr_2.0.1 crayon_1.4.2 readxl_1.3.1 evaluate_0.14
[37] GGally_2.1.2 fs_1.5.0 fansi_0.5.0 xml2_1.3.2
[41] tools_4.1.2 hms_1.1.1 lifecycle_1.0.1 munsell_0.5.0
[45] reprex_2.0.1 compiler_4.1.2 jquerylib_0.1.4 rlang_0.4.12
[49] grid_4.1.2 rstudioapi_0.13 rmarkdown_2.11 gtable_0.3.0
[53] DBI_1.1.1 reshape_0.8.8 R6_2.5.1 gridExtra_2.3
[57] lubridate_1.8.0 knitr_1.36 fastmap_1.1.0 utf8_1.2.2
[61] rprojroot_2.0.2 stringi_1.7.5 parallel_4.1.2 Rcpp_1.0.7
[65] vctrs_0.3.8 dbplyr_2.1.1 tidyselect_1.1.1 xfun_0.28