aboutsummaryrefslogtreecommitdiff
path: root/bin/provision.R
diff options
context:
space:
mode:
Diffstat (limited to 'bin/provision.R')
-rwxr-xr-xbin/provision.R48
1 files changed, 48 insertions, 0 deletions
diff --git a/bin/provision.R b/bin/provision.R
new file mode 100755
index 0000000..a7b1bef
--- /dev/null
+++ b/bin/provision.R
@@ -0,0 +1,48 @@
+#!/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)