Reputation: 614
Amazon provides a clear installation guide for launching a micro instance and having R & RStudio installed. The guide can be found here: https://aws.amazon.com/blogs/big-data/running-r-on-aws/
Unfortunately this installs an older version of R. (3.2.2) which provides issues for certain packages, like slam, as they require an R version > 3.3.1
In the guide for the step to change the user data they provide the below script which covers the installation of R & RStudio. How do I change the script to install the latest version of R?
#!/bin/bash
#install R
yum install -y R
#install RStudio-Server
wget https://download2.rstudio.org/rstudio-server-rhel-0.99.465-x86_64.rpm
yum install -y --nogpgcheck rstudio-server-rhel-0.99.465-x86_64.rpm
#install shiny and shiny-server
R -e "install.packages('shiny', repos='http://cran.rstudio.com/')"
wget https://download3.rstudio.org/centos5.9/x86_64/shiny-server-1.4.0.718-rh5-x86_64.rpm
yum install -y --nogpgcheck shiny-server-1.4.0.718-rh5-x86_64.rpm
#add user(s)
useradd username
echo username:password | chpasswd
Thanks
Upvotes: 3
Views: 6219
Reputation: 575
Try this:
# Install r-base
yum install r-base
# Install newest version of R from source
wget https://cran.r-project.org/src/base/R-3/R-3.4.0.tar.gz
./configure --prefix=/home/$user/R/R-3.4.0 --with-x=yes --enable-R-shlib=yes --with-cairo=yes
make
# NEWS.pdf file is missing and will make installation crash.
touch doc/NEWS.pdf
make install
# Do not forget to update your PATH
export PATH=~/R/R-3.4.0/bin:$PATH
export RSTUDIO_WHICH_R=~/R/R-3.4.0/bin/R
I ripped this from an ubuntu R install how-to: http://jtremblay.github.io/software_installation/2017/06/21/Install-R-3.4.0-and-RStudio-on-Ubuntu-16.04
Upvotes: 3