R Language - R installation and RStudio (Linux, Windows dual record)

Creative Commons License Copyright: Attribution, allow others to create paper-based, and must distribute paper (based on the original license agreement with the same license Creative Commons )

  • The default is 64-bit systems
  • Not mean, I do not have Mac book, so there is no record of Mac

Linux - B / S Mode

system Release Operating system version
deepin deepin-15.10.1-amd64 Debian 6.3.0-18 + deb9u1
software Software version Remark
R 3.3.3 From the warehouse is not actually download the latest version
RStudio Server 1.2.1335 This is the B / S Mode

1. Installation R locales

# 惯例 先来一波更新,
# nangy @ nangy-vm in ~ [12:18:50] 
$ sudo apt update 

# 基础环境安装,全自动的,安心看你的小视频吧
# nangy @ nangy-vm in ~ [12:19:59] 
$ sudo apt install r-base r-base-dev

2. Reboot the system

To form good habits, installing the configuration environment, certainly the first properly due to restart chant

# nangy @ nangy-vm in ~ [12:22:04] 
$ shutdown -r now

3. Verify that the installation was successful

Input R, see the following basic instructions successful installation environment

# nangy @ nangy-vm in ~ [12:34:29] 
$ R

R version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R是自由软件,不带任何担保。
在某些条件下你可以将其自由散布。'license()''licence()'来看散布的详细条件。

R是个合作计划,有许多人为之做出了贡献.'contributors()'来看合作者的详细情况'citation()'会告诉你如何在出版物中正确地引用R或R程序包。
'demo()'来看一些示范程序,用'help()'来阅读在线帮助文件,或'help.start()'通过HTML浏览器来看帮助文件。'q()'退出R.

# 退出
> q()
# 提示是否保存工作空间,一般保存呗,万一以后用呢
Save workspace image? [y/n/c]: y

Thus, R language basic environment in the installation configuration

4. Install the deb installer

If you have installed, omit this step

# nangy @ nangy-vm in ~ [13:13:29] 
$ sudo apt install gdebi-core

5. Install RStudio Server

# 不知为何,我用这个包安装成功了,so,我就下载这个了
# nangy @ nangy-vm in ~ [13:14:31] 
$ wget https://download2.rstudio.org/server/debian9/x86_64/rstudio-server-1.2.1335-amd64.deb
  • Start the installation RStudio Server
# nangy @ nangy-vm in ~ [13:18:47] 
$ sudo gdebi rstudio-server-1.2.1335-amd64.deb

6. The multi-users share a libpath

Each user will have its own mounting a lpackages for convenience, designated the default path R

  • Modify / etc / rstudio profile in the path ression.conf
# 切换到root用户
# nangy @ nangy-vm in ~ [13:41:31] 
$ su

# 编辑/etc/rstudio/rsession.conf
# root @ nangy-vm in ~ [13:41:50] 
$ vim /etc/rstudio/rsession.conf 
  • Fill in the following contents and save and exit
r-libs-user=/usr/lib64/R/library
  • Authorized users in the directory permissions, or the installation there is an error, because there is no permission to write
    Without this directory, manually create
# root @ nangy-vm in ~ [13:49:39] 
$ ll /usr/lib64/R/library
ls: 无法访问'/usr/lib64/R/library': 没有那个文件或目录

# root @ nangy-vm in ~ [13:49:51] C:2
$ cd /usr/lib64 

# root @ nangy-vm in /usr/lib64 [13:50:21] 
$ mkdir R

# root @ nangy-vm in /usr/lib64 [13:50:35] 
$ cd R 

# root @ nangy-vm in /usr/lib64/R [13:50:47] 
$ mkdir library

# 授权
# root @ nangy-vm in /usr/lib64/R [13:50:56] 
$ chmod -R 777 /usr/lib64/R/library 

# root @ nangy-vm in /usr/lib64/R [13:51:34] 
$ ll
总用量 4.0K
drwxrwxrwx 2 root root 4.0K 6月  17 13:50 library

7. state related commands

#查看是否安装正确 
sudo rstudio-server verify-installation 
## 启动 
sudo rstudio-server start 
## 查看状态 
sudo rstudio-server status 
## 停止 
sudo rstudio-server stop 
## 重启
sudo rstudio-server restart
## 查看服务端ip地址 
ifconfig

8. After installation, the default login address: http://127.0.0.1:8787/

Map with the truth
Here Insert Picture Description
Here Insert Picture Description

So far, Linux version R RStudio Server installation and configuration

Windows - C / S mode

system Release Operating system version
Windows Windows 10 Professional x64 17134.829
Windows Windows 7 Professional x64 Service Pack 1
software Software version Remark
R 3.6.0 Of course, with the latest, the old version of the stepped pit
RStudio 1.2.1335 This is the C / S mode

The following installationpick one of twoOn the line
want loaded to force, simply choose to step [2] (loaded to force installation)
only if you copy from someone else already installed R, RStudio file

1. Install and R RStudio (installation fool)

1.1 official website to download the installation package

If you want to download the version history, please click here

1.2 Installation R

It is strongly recommended to change the path, simple and crude point, directly into C or D E
Then go all the way next
It is strongly recommended to change the path, simple and crude point, directly into C or D E
Here Insert Picture Description
to find Rgui.exe (R comes UI interface) of several paths:
E: \ Program Files \ R \ R-3.6.0 \ bin \ x64 \ Rgui.exe
Start Menu -> All Programs - > R -> R x64 3.6.0
If you see the following interface, installation is successful
Running interface

1.3 Installation RStudio

It is strongly recommended to change the path, simple and crude point, directly into C or D E
Then go all the way next
Here Insert Picture Description
can find several paths rstudio.exe of:
E: \ Program Files \ RStudio \ bin \ rstudio.exe
Start Menu -> All Programs -> RStudio -> RStudio
If you see the following interface, installation is successful
Running interface

At this point, Windows version of R and RStudio fool installation is complete, do not want loaded to force, the following can not read

2. Installation and R RStudio (loading force installation)

In fact, the loading force is to manually configure the environment only, and little wonder stuff
before with R-3.3.3 sister loaded to force in the face of failure, but fortunately with R-3.6.0 loaded to force a success, it did not beaten face
suggest that you live within its means as, you know, the occasional compatibility issues easy to step pit

2.1 to copy someone else's files into the machine specified directory

Develop good habits, try not to put the system disk (which is often said the C drive)

software My own path
R-3.6.0 E: \ Program Files \ R \ R-3.6.0
RStudio-1.2.1335 E: \ Program Files \ R \ RStudio-1.2.1335

2.2 Configuration Environment Variables

2.2.1 New Environment Variables

variable name value
R_HOME E: \ Program Files \ R \ R-3.6.0

2.2.2 Configuration Path variable

variable name value
Path %R_HOME%\bin

2.3 The best restart the system

shutdown -r -t 0

找到 rstudio.exe: E: \ Program Files \ R \ RStudio-1.2.1335 \ bin \ rstudio.exe
Open see the following interface is configured successfully
Running interface

At this point, Windows version of R and RStudio loaded to force installation complete

Guess you like

Origin blog.csdn.net/nangy2514/article/details/92596556