Install and setup R, RStudio, Rcpp

Install and setup R, RStudio, Rcpp

Ubuntu

  • add deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ to your /etc/apt/sources.list (replace bionic with the name of your Ubuntu version)
  • install R, Rcpp and RInside:
sudo apt-get update
sudo apt-get install r-base r-base-dev r-cran-rinside r-cran-rcpp

Windows

1. Install R

2. Install RTools

see also: https://thecoatlessprofessor.com/programming/cpp/installing-rtools-for-compiled-code-via-rcpp/

Rtools provides a compiler and some helpers to compile code for R in Windows

  • Download Rtools https://cran.r-project.org/bin/windows/Rtools/
    • Select the appropriate Rtools version (3.5 with R 3.6.3)
  • Install Rtools in a directory with no fancy characters in its path, e.g. C:\R\Rtools is safe
    • Right click on the “Rtools34.exe” and select “Run as administrator” to install it
    • Select “Add Rtools to PATH”
    • Accept all defaults for everything else

3. Install RStudio

Install Rcpp & RInside

  • in RStudio: install.packages(c("RInside", "Rcpp"))
Avatar
Sebastian Hanß
PhD student & Scientific programmer

spatial ecology, biodiversity and ecosystem functioning, savanna and dryland ecology, concepts and theoretical ecology and dynamic simulation models.