從GitHub安裝R包報(bào)錯(cuò)Error: Failed to install 'Rpackage' from GitHub: Does not appear to be an R package (no DESCRIPTION)
一祖娘、問(wèn)題:
前天在辦公室電腦上安裝上了“四個(gè)萬(wàn)能包”生信技能樹良心佳作-Jimmy的四個(gè)萬(wàn)能R包佛掖;昨天在自己電腦上安裝生信技能樹良心佳作-Jimmy的四個(gè)萬(wàn)能R包
報(bào)錯(cuò)如下:Error: Failed to install 'idmap2' from GitHub:
Does not appear to be an R package (no DESCRIPTION)
搜索了一下,這個(gè)報(bào)錯(cuò)還是挺常見的沃琅,看了很多推文沒有找到這一問(wèn)題的解決辦法。
二澈蚌、從GitHub上安裝R包的方法
首先盔几,要了解從Github上裝R包的方法:
主要有兩種:
第一種:
library(devtools)
install_github("xx.Rpackage")
第二種:
BiocManager::install('githubinstall')
library(githubinstall)
githubinstall("xx.Rpackage")
從GitHub安裝R包當(dāng)然還有其他方法,更多細(xì)節(jié)可以參考下列推文:
???[轉(zhuǎn)載][R]從Github上輕松安裝R包①—githubinstall包
???[R]從Github上輕松安裝R包②補(bǔ)充
???[轉(zhuǎn)載][R]從Github上輕松安裝R包—githubinstall包 - 簡(jiǎn)書 http://www.reibang.com/p/b33dc9d994a9
三纯路、解決方法
嘗試各種安裝方法或油,看報(bào)錯(cuò)信息,發(fā)現(xiàn)報(bào)錯(cuò)信息都一樣驰唬。
library(devtools)
install_github("jmzeng1314/idmap2")
Downloading GitHub repo jmzeng1314/idmap2@master
jmzeng1314-idmap2-cd335d6/data/GPL10333.rda: truncated gzip input
tar.exe: Error exit delayed from previous errors.
Error: Failed to install 'idmap2' from GitHub:
Does not appear to be an R package (no DESCRIPTION)
In addition: Warning messages:
1: In utils::untar(tarfile, ...) :
‘tar.exe -xf "C:\Users\ljx\AppData\Local\Temp\Rtmp4yLw2n\filea2c30364ca.tar.gz" -C "C:/Users/ljx/AppData/Local/Temp/Rtmp4yLw2n/remotesa2c439e24db"’ returned error code 1
2: In system(cmd, intern = TRUE) :
running command 'tar.exe -tf "C:\Users\ljx\AppData\Local\Temp\Rtmp4yLw2n\filea2c30364ca.tar.gz"' had status 1
今天花費(fèi)了兩個(gè)多小時(shí)才解決装哆,嘗試了如下的方法:
install_github("jmzeng1314/idmap2")
library(idmap2)
BiocManager::install('githubinstall')
library(githubinstall)
githubinstall("jmzeng1314/idmap2")
devtools::install_github("jmzeng1314/idmap2", subdir = "pkg")
devtools::install_github('jmzeng1314/idmap2')
idmap2 = devtools:::source_pkg("idmap2-master")
install(idmap2)
githubinstall("idmap2")
githubinstall::idmap2
githubinstall::githubinstall("idmap2")
以上安裝全部失敗。
四定嗓、終極解決辦法:本地安裝
終極解決辦法:本地安裝
devtools::install_local("idmap2.zip")
> devtools::install_local("idmap2.zip")
Installing package into ‘C:/Users/ljx/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
* installing *source* package 'idmap2' ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'idmap2'
finding HTML links ... done
get_soft_IDs html
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path
* DONE (idmap2)
安裝成功
> library(idmap2)
idmap2 v 0.1.0 welcome to use idmap2!
If you use idmap2 in published research, please acknowledgements:
We thank Dr.Jianming Zeng(University of Macau), and all the members of his bioinformatics team, biotrainee, for generously sharing their experience and codes.