Install R & RStudio for Ubuntu

Install R

r-project.org official source to install the latest R system.

add R source

 
sudo vi /etc/apt/sources.list

# append below line to end of sources.list

# you can view mirror at http://cran.r-project.org/mirrors.html

deb http://ftp.ctex.org/mirrors/CRAN/bin/linux/ubuntu precise/

import the GPG key and install r-base

 
cd ~

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E084DAB9

gpg -a --export E084DAB9 | sudo apt-key add -

apt-get upgrade

apt-get install r-base

ROracle is much faster compare with RODBC or RJDBC in performance, You can found new version of ROracle or DBI package in CRAN, it is also required you properly install the Oracle Instant Client.
manual install the ROracle
 
wget http://cran.r-project.org/src/contrib/DBI_0.2-7.tar.gz

R CMD INSTALL DBI_0.2-7.tar.gz

wget http://cran.r-project.org/src/contrib/ROracle_1.1-11.tar.gz

R CMD INSTALL --configure-args=‘--with-oci-inc=/opt/oracle/instantclient_11_2/sdk/include --with-oci-lib=/opt/oracle/instantclient_11_2‘ ROracle_1.1-11.tar.gz

RStudio Server

Install RStudio Server

 
apt-get install gdebi-core

apt-get install libapparmor1 # Required only for Ubuntu, not Debian

wget http://download2.rstudio.org/rstudio-server-0.97.551-i386.deb

gdebi rstudio-server-0.97.551-i386.deb

rstudio-server verify-installation

 
echo ‘rsession-memory-limit-mb=1000‘ > /etc/rstudio/rserver.conf

echo ‘rsession-stack-limit-mb=4‘ >> /etc/rstudio/rserver.conf

echo ‘rsession-process-limit=20‘ >> /etc/rstudio/rserver.conf

# Only pass below if you will using proxy mode

echo ‘www-address=127.0.0.1‘ >> /etc/rstudio/rserver.conf

groupadd rstudio

This section is optional, assured already install nginx in server.
 
# do not forgot link to /opt/nginx/conf/vhosts

server {

listen 80;

server_name cvprstudio;

location / {

proxy_pass http://localhost:8787;

proxy_redirect http://localhost:8787/ $scheme://$host/;

}

}

 
ln -s /usr/lib/rstudio-server/extras/init.d/debian/rstudio-server /etc/init.d/rstudio-server

vi /etc/init.d/rstudio-server

vi
 
# append below line to /usr/lib/rstudio-server/extras/init.d/debian/rstudio-server SCRIPTNAME

ORACLE_BASE=/opt/oracle

ORACLE_HOME=/opt/oracle/instantclient_11_2

TNS_ADMIN=/opt/oracle/network/admin

NLS_LANG=AMERICAN_AMERICA.AL32UTF8

Now you can restart rstudio-server via standard init.d service way
 
/etc/init.d/rstudio-server restart
 
adduser --ingroup rstudio cindy

passwd cindy # setting password

Usually it is more good to upgrade the r-base in system wide packages instead of per user.
after run R in root console
 
update.packages() # select mirror to check

转:http://blog.cloud-mes.com/2012/09/16/install-r-and-rstudio-in-ubuntu/

时间: 2024-10-31 15:00:50

Install R & RStudio for Ubuntu的相关文章

How To Manually Install Oracle Java on Ubuntu

Introduction Java is a programming technology originally developed by Sun Microsystems and later acquired by Oracle. Oracle Java is a proprietary implementation for Java that is free to download and use for commercial use, but not to redistribute, th

Install LAMP Stack On Ubuntu 16.04

原文:http://www.unixmen.com/how-to-install-lamp-stack-on-ubuntu-16-04/ LAMP is a combination of operating system and open-source software stack. The acronym LAMP came from the first letters ofLinux, Apache HTTP Server, MySQL or MariaDB database, and PH

R&&rstudio

R sudo apt-get install R-base Rstudio(zanshianzhuangshibai???) zaiwangzhanxiazaihaoleduiyingbanbendeRstudio sudo apt-get install gdebi-core 如果提示少了什么东西,运行下面的命令 sudo apt-get -f install 重新安装gebedi sudo apt-get install gdebi-coresudo apt-get install liba

HOWTO install Oracle 11g on Ubuntu Linux 12.04 (Precise Pangolin) 64bits

安装了Ubuntu 12.04 64bit, 想在上面安装Oracle 11gr2,网上找了好多文档都没成功,最后完全参考了MordicusEtCubitus的文章. 成功安装的关键点:install additional packages, 在link过程中处理错误的方法. 原文:http://www.makina-corpus.org/blog/howto-install-oracle-11g-ubuntu-linux-1204-precise-pangolin-64bits Before

Install laravel 5 on ubuntu server

Install laravel 5 on ubuntu server http://laravel.io/forum/06-10-2015-solved-install-laravel-5-on-ubuntu-server https://www.digitalocean.com/community/questions/how-to-install-laravel-5-on-ubuntu-nginx-server https://www.digitalocean.com/community/tu

Install Google Pinyin on Ubuntu 14.04

Install Google Pinyin on Ubuntu 14.04 I've been spending more and more time on Ubuntu and I'm not used to the Chinese keyboard that ships with Ubuntu. The keyboard on Android works pretty well so here's a quick tutorial on how to install it on Ubuntu

Install eclipse ns3 in ubuntu 14.04

1. NS3 install 参考NS3 tutorial即可. 2.eclipse 2.1下载 下载地址:http://www.eclipse.org/downloads/               Eclipse IDE for C/C++ Developers NOTE: you can know whether your ubuntu is 32-bit or 64-bit by executing the command "uname -m". 如果显示i686,你安装了3

Install a Redmine on Ubuntu system

# How to install a Redmine on Ubuntu system Ref to: https://www.linode.com/docs/applications/project-management/how-to-install-and-configure-redmine-on-ubuntu-16-04 # Change the password of admin user Above all, you need to switch into root role ```

install r on ubuntu

install r-base on ubuntu: sudo apt-get install -y r-base download rstudio: https://download1.rstudio.org/rstudio-1.0.153-amd64.deb install gui tool(rstudio) for r language: sudo dpkg -i rstudio-***-amd64.deb some examples for r language: *** # librar