diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-06-06 08:17:18 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-06-06 08:17:18 -0300 |
commit | 515bdd658d91020c73f82b70ff001015b359adc0 (patch) | |
tree | e7c62578e2ef61bf7c9a46de91d92d37620553fe /bin/provision.R | |
download | bookup-515bdd658d91020c73f82b70ff001015b359adc0.tar.gz bookup-515bdd658d91020c73f82b70ff001015b359adc0.tar.bz2 |
Initial import
Diffstat (limited to 'bin/provision.R')
-rwxr-xr-x | bin/provision.R | 48 |
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) |