如何在R中从GitHub下载安装rmaxent包?安装报错求助
安装rmaxent包失败求助
我想要使用Maxent方法构建仅存在物种分布模型,找到了一份完全符合分析需求的在线教程,但在从GitHub下载安装rmaxent包时遇到问题,尝试三种方法均失败,详情如下:
尝试1
代码:
#install the package maxent library(devtools) install.packages("remotes") remotes::install_github("johnbaums/rmaxent")
错误信息:
Using GitHub PAT from the git credential store. Error: Failed to install 'unknown package' from GitHub: HTTP error 401. Bad credentials Rate limit remaining: 59/60 Rate limit reset at: 2024-10-08 10:42:59 UTC
尝试2
代码:
# download maxent.jar 3.3.3k, and place the file in the desired folder; note that, there may be a newer version of Maxent if( !file.exists(paste0(system.file("java", package="dismo"),"/maxent.jar")) ) { utils::download.file(url="https://raw.githubusercontent.com/mrmaxent/Maxent/master/ArchivedReleases/3.3.3k/maxent.jar", destfile=paste0(system.file("java", package="dismo"),"/maxent.jar"), mode="wb") ## wb for binary file, otherwise maxent.jar can not execute } #Open the library rmaxent library(maxent)
错误信息:
Error in library(package, pos = pos, lib.loc = lib.loc, character.only = TRUE, : there is no package called ‘maxent’
尝试3
代码:
install.packages("https://raw.githubusercontent.com/mrmaxent/Maxent/master/ArchivedReleases/3.3.3k/maxent.jar", repos = NULL, type="source")
错误信息:
trying URL 'https://raw.githubusercontent.com/mrmaxent/Maxent/master/ArchivedReleases/3.3.3k/maxent.jar' Content type 'application/octet-stream' length 673246 bytes (657 KB) ================================================== downloaded 657 KB Error in rawToChar(block[seq_len(ns)]) : embedded nul in string: 'PK\003\004\024\0\b\0\b\0\xdclO?\0\0\0\0\0\0\0\0\0\0\0\0\t\0\004\0META-INF/\xfe\xca\0\0\003\0PK\a\b\0\0\0\0\002\0\0\0\0\0\0\0PK\003\004\024\0\b\0\b\0\xdclO?\0\0\0\0\0\0\0\0\0\0\0\0\024\0\0\0META-INF/' Warning in install.packages : installation of package ‘/var/folders/4p/9pwl2nwj6h7glyzr26kvwr2w0000gn/T//Rtmp5t168W/downloaded_packages/maxent.jar’ had non-zero exit status
希望有人能帮忙解决该问题,提前感谢。
内容的提问来源于stack exchange,提问作者Alice Hobbs
相关产品推荐
相关产品推荐

