我试图在R中安装'mapview'包。我尝试重新启动R,清除环境,终止所有会话,重新启动并使用全新的会话。但我一直得到相同的错误信息:
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘terra’ 1.4-11 is being loaded, but >= 1.5.12 is required
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> namespaceImport -> loadNamespace
Execution halted
ERROR: lazy loading failed for package ‘mapview’
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mapview’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/mapview’
Warning in install.packages :
installation of package ‘mapview’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/hc/5lcwxt3j5xg0bnng9j68qms00000gn/T/RtmpUa3EvN/downloaded_packages’
错误Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : namespace ‘≪package≫’ ≪versionX≫ is being loaded, but >= ≪versionY≫ is required
表示软件包≪package≫
ís存在但已过时,因此无法成功加载。
在R中更新CRAN包
你可以通过重新安装terra
包来更新它:
install.packages('terra')
或者使用:
update.packages(oldPkgs='terra')
或在RStudio中通过Tools>
更新所有CRAN包
你可以使用以下命令更新所有的包:
update.packages()
或者如上所述通过RStudio。