アトトック代表の開発ブログ

プログラミングのことや趣味のことなど書いてます。

R言語 - CentosにRをインストール

RailsのアプリとRのプログラムを連携するためCentosにRをインストールしてみました。

Rをインストール

 $ sudo yum install R
 [sudo] password for kuru: 
 Loaded plugins: fastestmirror, security
 Setting up Install Process
 Determining fastest mirrors
       ・
       ・
       ・

R Studio Serverをインストール

https://www.rstudio.com/products/rstudio/download-server/

CentOSのバージョンごアーキテクチャの確認

$ cat /etc/redhat-release
CentOS release 6.6 (Final)
$ arch
x86_64
$ 

R Studio Serverをダウンロード

$ wget https://download2.rstudio.org/rstudio-server-rhel-1.1.442-x86_64.rpm
--2018-04-16 17:30:24--  https://download2.rstudio.org/rstudio-server-rhel-1.1.442-x86_64.rpm
Resolving download2.rstudio.org... 13.32.52.104, 13.32.52.17, 13.32.52.29, ...
Connecting to download2.rstudio.org|13.32.52.104|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 45677252 (44M) [application/x-redhat-package-manager]
Saving to: `rstudio-server-rhel-1.1.442-x86_64.rpm'
       ・
       ・
       ・

R Studio Serverが起動しているか確認

$ sudo rstudio-server verify-installation
rstudio-server stop/waiting
rstudio-server start/running, process 21909

R Studio Serverにアクセスしてみる。

ブラウザでポート番号 8787でアクセスします。

http://xxx.xxx.xxx.xxx:8787

R Studioのログイン画面が表示されるのでログインする。 ※ログインのアカウントはサーバーのアカウント

ブラウザにR Studioの画面が表示されます。