R 报错

问题1:

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

sudo R
update.packages()

问题2:
依赖包安装出错
解决方案:仔细查看报错信息,解决问题
例如:

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系统)

sudo aptitude install libgit2-dev

问题3:
安装ggthemr报错

> 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) 

解决方案:仔细查看报错信息,解决问题,,采用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!

你可能感兴趣的:(R 报错)