A simple walkthrough to install R and all the development tools needed to develop R packages on Centos 7.
As always, this is as much documentation for me as it is intended to be a tutorial but suggested corrections, additions and omissions are welcomed.
1. Install Base R
Install the latest extra packages release from the Fedora Project:
sudo yum install -y epel-release
Make sure to update and upgrade:
sudo yum update -y
sudo yum upgrade -y
Install base R:
sudo yum install -y R
2. Devtools Dependencies
Install some packages that are required by the devtools
package:
sudo yum groupinstall -y "Development Tools"
sudo yum install -y libcurl-devel openssl-devel libssh2-devel
Install devtools
:
sudo su - -c "R -q -e \"install.packages('devtools', repos = 'http://cran.rstudio.com/')\""
You’re all ready to develop! Now you just need to install and configure an RStudio webserver.
Bonus Points
Here is my handy function to install packages to the central library from the command line:
function installr {
ids=( $@ )
id="${ids[@]}";
pr=$( echo "c('${id// /','}')")
sudo su - -c "R -q -e \"install.packages(${pr}, repos = 'http://cran.rstudio.com/')\""
}