编辑:我通过设置新库并将所有软件包重新安装到新位置来部分解决此问题。
我有OSX v10.13.6和R 3.5。在最新的OSX更新之后,R似乎找不到我已安装的任何软件包,并且它们也不出现在RStudio中。例如。尝试加载与ggplot2
安装在同一位置的.libPaths()
:
> .libPaths()
[1] "/Library/Frameworks/R.framework/Versions/3.5/Resources/library"
> list.files("/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
[1] "abind" "acepack" "airway" "annotate" "AnnotationDbi"
....
[96] "ggplot2" "git2r" "glue" "GO.db" "GOstats"
> library(ggplot2)
Error in library(ggplot2) : there is no package called ‘ggplot2’
> library("ggplot2", lib.loc=.libPaths())
Error in library("ggplot2", lib.loc = .libPaths()) :
there is no package called ‘ggplot2’