R官 :https://www.r-project.org/
RStudio:https://www.rstudio.com/
环境:windows11子系统(Ubuntu)
R安装
添加R下载源
# update indicessudo apt update -qq# install two helper packages we needsudo apt install --no-install-recommends software-properties-common dirmngr# add the signing key (by Michael Rutter) for these repos# To verify key, run gpg --show-keys /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc # Fingerprint: E298A3A825C0D65DFD57CBB651716619E084DAB9wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as neededsudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
执行安装命令
sudo apt install --no-install-recommends r-base
输入R命令出现如下输出表示R安装成功
安装RStudio Server
下载安装包
https://www.rstudio.com/products/rstudio/download-server/
Download RStudio Server v2022.07.1+554
https://www.rstudio.com/products/rstudio/download-server/debian-ubuntu/
Install for Debian 10 / Ubuntu 18 / Ubuntu 20
sudo apt-get install gdebi-corewget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.07.1-554-amd64.debsudo gdebi rstudio-server-2022.07.1-554-amd64.deb
sudo apt-get install gdebi-core
wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.07.1-554-amd64.deb
sudo gdebi rstudio-server-2022.07.1-554-amd64.deb
创建Ubuntu用户
默认不允许root用户登录rstudio-server
创建用户命令
useradd -m username# username为创建的用户名,用于rstudio-server登录
修改用户密码命令
passwd username# 输入两遍密码即可
启动rstudio-server
rstudio-server start或重启rstudio-server restart
使用rstudio-server
打开浏览器输入地址:http://127.0.0.2:8787
127.0.0.1:8787
输入创建的Ubuntu用户名和密码登录
rstudio-server
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!