1.复制旧的R包到新的R library里面
# 查看原先R环境
conda env list
# 先创建环境
conda create --name r_4.2.2
# 安装新版R
source activate r_4.2.2
conda search r-base
conda install -c conda-forge r-base=4.2.2
# 拷贝R包
cp -r /home/username/miniconda3/envs/r403/lib/R/library /home/username/miniconda3/envs/r_4.2.2/lib/R/library
cd /home/username/miniconda3/envs/r403/lib/R/library
cd library
mv * ../
2.进入r_4.2.2环境
conda activate r_4.2.2
R
3. 更新迁移后的包
update.packages(checkBuilt=TRUE, ask=FALSE)
4. 查看更新结果代码
version
packageStatus()