码迷,mamicode.com
首页 > 其他好文 > 详细

All packages need to be reinstalled under the new version (4.0). I had to first remove and then reinstall all the packages.

时间:2021-06-02 11:43:04      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:following   cti   versions   ons   bpa   function   func   tps   code   

 

All packages need to be reinstalled under the new version (4.0). I had to first remove and then reinstall all the packages.

The following worked for me:

# check your package library path 
.libPaths()

# grab old packages names
old_packages <- installed.packages(lib.loc = "/Library/Frameworks/R.framework/Versions/3.6/Resources/library")
old_packages <- as.data.frame(old_packages)
list.of.packages <- unlist(old_packages$Package)

# remove old packages 
remove.packages( installed.packages( priority = "NA" )[,1] )

# reinstall all packages 
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages)
lapply(list.of.packages,function(x){library(x,character.only=TRUE)})

All packages need to be reinstalled under the new version (4.0). I had to first remove and then reinstall all the packages.

标签:following   cti   versions   ons   bpa   function   func   tps   code   

原文地址:https://www.cnblogs.com/xiaojikuaipao/p/14814292.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!