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
- download the *.deb file from https://rstudio.com/products/rstudio/download/#download and install it.
Windows
1. Install R
- Download R from https://cran.rstudio.com/bin/windows/base/R-3.6.3-win.exe
- Install R in a directory with no fancy characters in its path, e.g. C:\R\R-3.6.3 is safe
- Accept all defaults
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
- Download RStudio from https://rstudio.com/products/rstudio/download/#download
- Install R in a directory with no fancy characters in its path, e.g. C:\R\RStudio is safe
Install Rcpp & RInside
- in RStudio:
install.packages(c("RInside", "Rcpp"))