R& AWS EC2 Linux上的RStudio安装AMI - R的最新版本

时间:2017-02-10 04:13:20

标签: r linux amazon-web-services amazon-ec2 rstudio

Amazon提供了一个明确的安装指南,用于启动微型实例并使用R&已安装RStudio。该指南可在此处找到:https://aws.amazon.com/blogs/big-data/running-r-on-aws/

不幸的是,这会安装旧版本的R.(3.2.2),它会为某些软件包提供问题,例如slam,因为它们需要R版本> 3.3.1

在更改用户数据的步骤指南中,他们提供了以下脚本,该脚本涵盖了R& S的安装。 RStudio。如何更改脚本以安装最新版本的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

由于

1 个答案:

答案 0 :(得分:1)

试试这个:

# 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

我从ubuntu R安装方法中删除了这个:http://jtremblay.github.io/software_installation/2017/06/21/Install-R-3.4.0-and-RStudio-on-Ubuntu-16.04