diff --git a/.gitignore b/.gitignore index c2c8b2614a5136064c19c2924a67dbc3292baa0d..b5404c2b8ec307c56aefd7c53b9dd0027f5ecf7c 100755 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,4 @@ rsAbsence.pdf # some folders misc/ +submission/ diff --git a/Dockerfile b/Dockerfile index 2fd937f910a186846341667a9ff8213f0c3d08e4..5fda983d1c615820982ab83d407615f4157459a0 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ## set R version (https://hub.docker.com/r/rocker/verse/tags) -FROM rocker/verse:4.2.3 +FROM rocker/verse:4.3 ## name of the manuscript (as in Makefile and paper/Makefile) ENV FILE=rsabsence diff --git a/Makefile b/Makefile index 3f8d79738a67f326be1b71899929fc6721538be5..2b01c0680eed98bbc519fc96a030c2bdf7a61037 100755 --- a/Makefile +++ b/Makefile @@ -13,19 +13,10 @@ dbuild: Dockerfile docker build \ -t $(FILE) . -## run docker image that produces pdf from within docker +## run docker image that produces *tex* from within docker +## and compiles to *pdf* outside docker docker: dbuild docker run \ - --rm \ - --env pdfdocker="true" \ - --env FILE=$(FILE) \ - --volume $(CURDIR):/output \ - $(FILE) - mv $(FILE).pdf ./ - -## run docker image that produces tex from within docker -docker2: dbuild - docker run \ --rm \ --env FILE=$(FILE) \ -v $(CURDIR):/output \ @@ -37,3 +28,13 @@ docker2: dbuild rmdir figure/ cd paper && make pdf2 clean mv paper/$(FILE).pdf ./ + +## run docker image that produces *pdf* from within docker +docker2: dbuild + docker run \ + --rm \ + --env pdfdocker="true" \ + --env FILE=$(FILE) \ + --volume $(CURDIR):/output \ + $(FILE) + mv $(FILE).pdf ./ diff --git a/README.md b/README.md index 7632c2e1d446f6bfe2bae24d12f7b8e2ea800757..bf271fe7cdfc82574a411ca91c2be4c30f9256d9 100755 --- a/README.md +++ b/README.md @@ -11,35 +11,41 @@ Our results can be reproduced in two ways ### 1. Reproducing the results locally -Make sure that LaTeX (e.g., texlive-full on Ubuntu), R, and the R packages -indicated in the `./CRANpackages.txt` file are installed + +Make sure that R, and the R packages indicated in the `./CRANpackages.txt` file +are installed ```sh ## install packages from CRAN by running from a shell R -e 'install.packages(read.delim("CRANpackages.txt", header = FALSE)[,1])' ``` -Then run +To only rerun the R code without recompiling the manuscript use the file +`./paper/rsabsence.R`. To recompile the manuscript, make also sure that Make, +LaTeX and all necessary LaTeX packages (e.g., the texlive-full distribution on +Ubuntu) are installed. Then run ``` make local ``` -this should produce `./rsabsence.pdf` +this should produce `./rsabsence.pdf`. + Although the analyses depend on only few dependencies, this approach may lead to different results (or not even compile successfully) in the future if R or the -packages change. The R and R package versions which were used when the thesis -was successfully compiled the last time are visible in the following output +packages change. The R and R package versions which were used when the paper was +successfully compiled before submission are visible in the following output ```r sessionInfo() -#> R version 4.2.3 (2023-03-15) +#> R version 4.3.0 (2023-04-21) #> Platform: x86_64-pc-linux-gnu (64-bit) #> Running under: Ubuntu 20.04.6 LTS +#> #> Matrix products: default -#> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 +#> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 #> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0 #> #> locale: @@ -50,40 +56,42 @@ sessionInfo() #> [9] LC_ADDRESS=C LC_TELEPHONE=C #> [11] LC_MEASUREMENT=de_CH.UTF-8 LC_IDENTIFICATION=C #> +#> time zone: Europe/Zurich +#> tzcode source: system (glibc) +#> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> other attached packages: -#> [1] reporttools_1.1.3 xtable_1.8-4 dplyr_1.1.1 gridExtra_2.3 +#> [1] reporttools_1.1.3 xtable_1.8-4 dplyr_1.1.2 gridExtra_2.3 #> [5] ggplot2_3.4.2 knitr_1.42 #> #> loaded via a namespace (and not attached): -#> [1] fansi_1.0.4 withr_2.5.0 utf8_1.2.3 grid_4.2.3 -#> [5] R6_2.5.1 lifecycle_1.0.3 gtable_0.3.3 magrittr_2.0.3 -#> [9] scales_1.2.1 pillar_1.9.0 rlang_1.1.0 cli_3.6.1 -#> [13] generics_0.1.3 vctrs_0.6.1 tools_4.2.3 glue_1.6.2 -#> [17] munsell_0.5.0 xfun_0.38 compiler_4.2.3 pkgconfig_2.0.3 -#> [21] colorspace_2.1-0 tidyselect_1.2.0 tibble_3.2.1 +#> [1] vctrs_0.6.2 cli_3.6.1 rlang_1.1.0 xfun_0.39 +#> [5] generics_0.1.3 labeling_0.4.2 glue_1.6.2 colorspace_2.1-0 +#> [9] scales_1.2.1 fansi_1.0.4 grid_4.3.0 munsell_0.5.0 +#> [13] tibble_3.2.1 lifecycle_1.0.3 compiler_4.3.0 pkgconfig_2.0.3 +#> [17] farver_2.1.1 viridisLite_0.4.1 R6_2.5.1 tidyselect_1.2.0 +#> [21] utf8_1.2.3 pillar_1.9.0 magrittr_2.0.3 tools_4.3.0 +#> [25] withr_2.5.0 gtable_0.3.3 cat(paste(Sys.time(), Sys.timezone(), "\n")) -#> 2023-04-06 13:56:17 Europe/Zurich +#> 2023-05-08 09:19:12.440643 Europe/Zurich ``` ### 2. Reproducing the results within a Docker container -Make sure that Docker with root rights is installed. Then run +Make sure that Make, LaTeX with all necessary packages (e.g., the texlive-full +distribution on Ubuntu), and Docker with root rights are installed. Then run ``` make docker ``` -This may take some time as TinyTeX needs to install several LaTeX packages (run -`make docker2` to compile only R code within the container but run LaTeX -locally). The Docker approach reruns the analyses in a Docker container which -encapsulates the computational environment (R and R package versions) that was -used in the original analysis. The only way this approach could become -non-reproducible is when the -[rocker/verse](https://hub.docker.com/r/rocker/verse/tags) base image becomes -unavailable and/or the Posit Public Package Manager (RStudio Package Manager, -RSPM) snapshot of CRAN becomes unavailable. +The Docker approach reruns the analyses in a Docker container which encapsulates +the computational environment (R and R package versions) that was used in the +original analysis. The only way this approach could become non-reproducible is +when the [rocker/verse](https://hub.docker.com/r/rocker/verse/tags) base image +becomes unavailable and/or the Posit Public Package Manager (RStudio Package +Manager, RSPM) snapshot of CRAN becomes unavailable. diff --git a/rsabsence.pdf b/rsabsence.pdf index 7e2e8680c4a3b98936af4777beb42470e9824070..9f8dd90f70396a8140799ac48760b49a3dbf3b8b 100644 Binary files a/rsabsence.pdf and b/rsabsence.pdf differ