Rstudio-server 更改R版本

第一步 安装conda

1
2
3
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-py39_4.11.0-Linux-x86_64.sh
./Miniconda3-py39_4.11.0-Linux-x86_64.sh
source ~/.bashrc
1
2
3
conda install -c conda-forge nano=2.9.8 -y
nano -K .condarc
conda clean -i

添加清华镜像:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/

第二步 安装R 4.1.3

1
2
3
4
conda create -n r_4_1_3 -c conda-forge r-base=4.1.3 -y
conda activate r_4_1_3
whereis R
# /home/rstudio/miniconda3/envs/r_4_1_3/bin/R

第三步 修改默认R版本

1
2
3
docker exec -it Rstudio /bin/bash
chmod 777 -R /etc/rstudio/
exit
1
2
3
4
nano -K /etc/rstudio/rserver.conf

# Server Configuration File
rsession-which-r=/home/rstudio/miniconda3/envs/r_4_1_3/bin/R
1
docker restart Rstudio

Rstudio-server 更改R版本
https://occdn.limour.top/1680.html
Author
Limour
Posted on
April 14, 2022
Licensed under