R 報(bào)錯(cuò)

問題1:

Installation path not writeable, unable to update packages: boot, class, KernSmooth, Matrix, nlme, nnet, spatial
解決方案:

sudo R
update.packages()

問題2:
依賴包安裝出錯(cuò)
解決方案:仔細(xì)查看報(bào)錯(cuò)信息,解決問題
例如:

Configuration failed to find libgit2 library. Try installing:
 * brew: libgit2 (MacOS)
 * deb: libgit2-dev (Debian, Ubuntu, etc)
 * rpm: libgit2-devel (Fedora, CentOS, RHEL)

打開終端,安裝libgit2-dev(我的電腦是Ubuntu系統(tǒng))

sudo aptitude install libgit2-dev

問題3:
安裝ggthemr報(bào)錯(cuò)

> install.packages("ggthemr")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
  package ‘ggthemr’ is not available (for R version 3.6.3)

> source("https://bioconductor.org/biocLite.R")
Error: With R version 3.5 or greater, install Bioconductor packages using BiocManager; see https://bioconductor.org/install

> if (!requireNamespace("BiocManager", quietly = TRUE))
+   install.packages("BiocManager")
> BiocManager::install("ggthemr")
Bioconductor version 3.10 (BiocManager 1.30.10), R 3.6.3 (2020-02-29)
Installing package(s) 'ggthemr'
Installation path not writeable, unable to update packages: boot, class, KernSmooth, Matrix, nlme, nnet, spatial
Warning message:
package ‘ggthemr’ is not available (for R version 3.6.3) 

解決方案:仔細(xì)查看報(bào)錯(cuò)信息,解決問題,,采用devtools安裝

install.packages("devtools")
library(devtools)
devtools::install_github("ggthemr")
# Error in parse_repo_spec(repo) :  Invalid git repo specification: 'ggthemr'
devtools::install_github("Mikata-Project/ggthemr")     #打開GitHub,找到地址,https://github.com/Mikata-Project/ggthemr

OK!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容