aboutsummaryrefslogtreecommitdiff
path: root/bin/provision.R
blob: a7b1befe4c1040dfeb67e876ac947f20f4cbb7d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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)