從GitHub安裝R包報錯Error: Failed to install 'Rpackage' from GitHub: Does not appear to be an R packa...

從GitHub安裝R包報錯Error: Failed to install 'Rpackage' from GitHub: Does not appear to be an R package (no DESCRIPTION)

一、問題:

前天在辦公室電腦上安裝上了“四個萬能包”生信技能樹良心佳作-Jimmy的四個萬能R包;昨天在自己電腦上安裝生信技能樹良心佳作-Jimmy的四個萬能R包

報錯如下:Error: Failed to install 'idmap2' from GitHub:
Does not appear to be an R package (no DESCRIPTION)

搜索了一下,這個報錯還是挺常見的,看了很多推文沒有找到這一問題的解決辦法。

二、從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包 - 簡書 http://www.itdecent.cn/p/b33dc9d994a9

三、解決方法

嘗試各種安裝方法,看報錯信息,發(fā)現(xiàn)報錯信息都一樣。

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

今天花費了兩個多小時才解決,嘗試了如下的方法:

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

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