Skip to content

Instantly share code, notes, and snippets.

@remlapmot
Last active December 1, 2021 13:59
Show Gist options
  • Save remlapmot/7bb50388e3f5e3106406103dd1aea70c to your computer and use it in GitHub Desktop.
Save remlapmot/7bb50388e3f5e3106406103dd1aea70c to your computer and use it in GitHub Desktop.
Helpful packages and their dependencies to install with a fresh install of R
#' ---
#' title: "Helpful packages and their dependencies to install with a fresh install of R"
#' author: Tom Palmer
#' date: 2020-03-27
#' ---
#' Tested on Ubuntu 18.04
if (Sys.info()["sysname"] == "Linux"){
system('sudo apt-get install -y libcurl4-openssl-dev')
system('sudo apt-get install -y libssl-dev')
system('sudo apt-get install -y libfreetype6-dev')
system('sudo apt-get install -y libmagick++-dev')
system('sudo apt-get install -y cargo')
system('sudo apt-get install -y libxml2-dev')
system('sudo apt-get install -y xorg')
system('sudo apt-get install -y libx11-dev')
system('sudo apt-get install -y libglu1-mesa-dev')
system('sudo apt-get install -y libatlas-base-dev')
system('sudo apt-get install -y gfortran')
system('sudo apt-get install -y libblas-dev')
system('sudo apt-get install -y liblapack-dev')
system('sudo apt install -y python-autopep8')
system('sudo apt install -y libftgl2 libcgal-dev')
system('sudo apt-get install -y libclang-dev libpq5')
}
install.packages(c('knitr', 'rmarkdown', 'bookdown', 'tidyverse', 'devtools', 'tinytex', 'pkgdown', 'remotes', 'markdown'), dependencies = TRUE)
remotes::install_github("MRCIEU/TwoSampleMR")
tinytex::install_tinytex()
tinytex::tlmgr_install("fira")
remotes::install_github("Hemken/Statamarkdown")
@remlapmot
Copy link
Author

remlapmot commented Mar 3, 2020

Run with (on Ubuntu I launch R with sudo R)

source("packages.R", echo = TRUE)
  • Installing the knitr dependencies, e.g. the png package, is helpful to avoid problems with html output and png figures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment