2017-02-10 119 views
1

Amazon提供了一個清晰的安裝指南,用於啓動微型實例並安裝了R & RStudio。該指南可以在這裏找到:https://aws.amazon.com/blogs/big-data/running-r-on-aws/AWS EC2上的R&RStudio安裝Linux AMI - 最新版本的R

不幸的是這R.安裝的是舊版本(3.2.2),它提供問題的某些包,喜歡扣籃,因爲它們需要的R版本> 3.3.1

在用於更改用戶數據步驟的指南中,他們提供了下面的腳本,其中介紹了R & 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 

感謝

+0

直接從CRAN安裝?請參閱https://www.r-bloggers.com/setting-up-an-aws-instance-for-r-rstudio-opencpu-or-shiny-server/ – chinsoon12

+0

您也可以使用docker安裝最新版本。 https://hub.docker.com/r/rocker/rstudio/ – PinkFluffyUnicorn

+0

嗨chinsoon,感謝您的參考。然而這個博客涵蓋了Ubuntu而不是Linux。 –

回答

0

試試這個:

# 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

相關問題