#!/usr/bin/env Rscript # # Install bookdown and dependencies. # See https://bookdown.org/yihui/bookdown/r-and-r-packages.html # # Environment variable "USE_DEVTOOLS" controls the way some # packages are installed. Useful in situations like these: # # * https://github.com/r-lib/remotes/issues/641 # * https://github.com/r-lib/remotes/issues/659 # * https://github.com/r-lib/devtools/issues/1566 # # Bookdown if (Sys.getenv("USE_DEVTOOLS") == "FALSE") { install.packages("bookdown", dependencies = TRUE) } else { if (!requireNamespace("devtools")) install.packages("devtools") devtools::install_github("rstudio/bookdown") } # PDF tools # This adds support to knitr in the HTML output # Requires libpoppler-cpp-dev and r-cran-magick if (Sys.getenv("USE_DEVTOOLS") == "FALSE") { install.packages("pdftools") } else { devtools::install_github("ropensci/pdftools") } # For Euler and Venn diagrams # See https://jolars.github.io/eulerr/ install.packages("eulerr") # Tufte install.packages('tufte') # Graphics support install.packages('ggplot2') # The xfun package # See https://bookdown.org/yihui/rmarkdown-cookbook/embed-file.html # https://github.com/yihui/xfun # https://yihui.org/xfun/ #install.packages('xfun', repos = 'https://yihui.r-universe.dev') # Update everything update.packages(ask = FALSE, checkBuilt = TRUE)