viridis ggplot2 颜色包不会安装,即使依赖项 = TRUE

viridis ggplot2 color package won't install , even with dependencies = TRUE

我启动了一个干净的 R Studio 实例。我不保存我的环境,也不使用 Rprofile 文件。我尝试了两个命令:

install.packages("viridis")
install.packages("viridis", dependencies = TRUE)

我得到这个错误:

  • installing source package ‘viridis’ ... ** package ‘viridis’ successfully unpacked and MD5 sums checked ** R ** inst ** preparing package for lazy loading Error : object ‘cividis’ is not exported by 'namespace:viridisLite' ERROR: lazy loading failed for package ‘viridis’
  • removing ‘/home/stackinator/Rlibs/viridis’ Warning in install.packages : installation of package ‘viridis’ had non-zero exit status

尝试以下操作:

if (!require("devtools")) install.packages("devtools")
devtools::install_github("sjmgarnier/viridis")

我不确定为什么从 CRAN 下载它不起作用,但是 devtools::install_github() 从存储库下载源包,而不是使用 install.packages()[= 从 CRAN 获得的捆绑包15=]

有关更多信息,请查看 R Packages book 中的讨论: http://r-pkgs.had.co.nz/package.html