之前直接用Rstudio 安装R包就没有成功过, 不过有文章说如果用conda管理的话最好就用conda 来安装R包,只要加上前缀r- , 如果是bioconductor 的包就是 bioconductor- , 安装命令如下
#先激活r的环境
conda activate r
#安装r包
conda install r-package_name
但是很多包在conda中并没有,需要通过devtools 从github上来安装,看到一个先安装rstudio再绑定R 的方法
-
install the latest RStudio from the official sources
-
Create your custom conda environment CUSTOMENV, including an installation of r-base
conda create -n CUSTOMENV -c conda-forge r-base'>=4.0.3' ... [further packages]
-
Activate the conda environment