首先,要安装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
$ 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
|
|
|
|
/etc/init.d/rstudio-server restart
Add a user in RStudio
|
|
注意,在这个地方,我用的用户名称是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 |
|
|
|