关于R以及Rstudio的安装过程 64位ubuntu12.04

首先,要安装R

1. Update the repositories to get the latest R distributions:

Use sudo vi /etc/apt/sources.list to add the following:

1
deb http://cran.stat.ucla.edu/bin/linux/ubuntu precise/

OR

1
sudo add-apt-repository "deb http://cran.stat.ucla.edu/bin/linux/ubuntu precise/"

2. Get the repository SSL key and import it in to apt.

1
2
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
gpg -a --export E084DAB9 | sudo apt-key add -

3. Update the repositories.

1
2
sudo apt-get update
sudo apt-get install r-base

Now you may go to the command prompt and type R to get the R console.


然后,安装ROracle和DBI

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/
这两个的过程大致是这个样子的,但是,DBI和ROracle的版本可能不一样的。
这个需要到他们的官方网站上去查看:

最后,安装Rstudio server
(千万要注意,linux的版本是64位的,不能够安装成为32位的了)
$ sudo apt-get install gdebi-core
$ sudo apt-get install libapparmor1  # Required only for Ubuntu, not Debian
$ wget http://download2.rstudio.org/rstudio-server-0.98.501-amd64.deb
$ sudo gdebi rstudio-server-0.98.501-amd64.deb
就是这些过程,其中,需要补充一个 psmisc_22.21-2_amd64.deb的安装
用wget获取包,再用gdebi进行安装就可以了


其后,这个rstudio server setting的设定:
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

Setting auto restart and PATH
       
       
       
       
ln -s /usr/lib/rstudio-server/extras/init.d/debian/rstudio-server /etc/init.d/rstudio-server
vi /etc/init.d/rstudio-server
      
      
      
      
# 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

/etc/init.d/rstudio-server restart



Add a user in RStudio
       
       
       
       
adduser --ingroup rstudio cindy
passwd cindy # setting password
注意,在这个地方,我用的用户名称是tutu,密码吗,你懂的


Update package

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
       
       
       
       
最后检查的时候



登陆上去,就可以看到了
使用linux的用户id和用户的password,当然,如果添加了组,也是可以的。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值