【问题标题】:installing package is failing with: Error in if (file.exists(dest) && file.mtime(dest)安装包失败: if (file.exists(dest) && file.mtime(dest) 中的错误
【发布时间】:2018-10-02 20:43:24
【问题描述】:

我正在尝试安装 rethinking

httr::set_config( httr::config( ssl_verifypeer = 0L ) ) 
with_config(use_proxy("http://myco.com:5555"), install_github("rmcelreath/rethinking", lib ="C://TOOLS/R-3.4.0/library"))

我收到错误消息:

Downloading GitHub repo rmcelreath/rethinking@master
from URL https://api.github.com/repos/rmcelreath/rethinking/zipball/master
Installing rethinking
Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) &&  : 
  missing value where TRUE/FALSE needed
Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) &&  : 
  missing value where TRUE/FALSE needed

关于我的版本的一些信息:

> packageVersion("devtools")
[1] ‘1.12.0’
> packageVersion("httr")
[1] ‘1.2.1’
> R.Version()$version.string
[1] "R version 3.4.0 (2017-04-21)"

你能告诉我如何让安装工作吗?

谢谢。

++++++++++++++ 当我运行 TRACEBACK() 时,我得到了

3: installed.packages()
2: as.data.frame(installed.packages(), stringsAsFactors = F)
1: (function () 
   {
       uniqueLibPaths <- .rs.uniqueLibraryPaths()
       x <- suppressWarnings(library(lib.loc = uniqueLibPaths))
       x <- x$results[x$results[, 1] != "base", ]
       pkgs.name <- x[, 1]
       pkgs.library <- x[, 2]
       pkgs.desc <- x[, 3]
       pkgs.url <- file.path("help/library", pkgs.name, "html", 
           "00Index.html")
       loaded.pkgs <- .rs.pathPackage()
       pkgs.loaded <- !is.na(match(normalizePath(paste(pkgs.library, 
           pkgs.name, sep = "/")), loaded.pkgs))
       instPkgs <- as.data.frame(installed.packages(), stringsAsFactors = F)
       pkgs.version <- character(length = length(pkgs.name))
       for (i in 1:length(pkgs.name)) {
           pkgs.version[[i]] <- .rs.packageVersion(pkgs.name[[i]], 
               pkgs.library[[i]], instPkgs)
       }
       pkgs.library <- .rs.createAliasedPath(pkgs.library)
       packages = data.frame(name = pkgs.name, library = pkgs.library, 
           version = pkgs.version, desc = pkgs.desc, url = pkgs.url, 
           loaded = pkgs.loaded, check.rows = TRUE, stringsAsFactors = FALSE)
       packages[order(packages$name), ]
   })()

【问题讨论】:

  • traceback 是什么?什么函数导致错误?在该函数上运行 debugonce 并找出哪些条件失败,看看你是否无法找出原因
  • so debugonce(with_config(use_proxy("myco.com:5555"), install_github("rmcelreath/rethinking", lib ="C://TOOLS/R-3.4.0/library")))?
  • @MichaelChirico 请查看更新
  • @user3022875 这似乎是 3.4.0 的一般错误。在窗户下。尝试重新安装补丁版本,看看是否有帮助.. cran.r-project.org/bin/windows/base/rpatched.html
  • 哇今天刚刚发布。我试试看。

标签: r


【解决方案1】:

这似乎是 3.4.0 的一般错误。在 Windows 下。

尝试重新安装补丁版本,看看是否有帮助..

https://cran.r-project.org/bin/windows/base/rpatched.html

更新: 3.4.1。已被释放。这也可以解决您的问题。 https://cran.r-project.org/bin/windows/base/

【讨论】:

  • 你,太棒了。确实是3.4.0的错误。我希望你得到你的复选标记;我只会给你一个赞成票:)
  • 好的,谢谢。作为记录,here's the note 提到了错误修复。
【解决方案2】:

我已将 devtools 包更新到最后一个 v1.13.2 并且在您尝试安装新包时避免了此类错误。而且我不需要安装另一个 R 版本,比如 3.4.1。

关于版本的一些信息:

packageVersion("devtools")

[1]‘1.13.2’

packageVersion("httr")

[1]‘1.2.1’

R.Version()$version.string

[1]《R 版本 3.4.0 (2017-04-21)》

【讨论】:

    【解决方案3】:

    卸载并重新安装 R3.4.0 为我解决了这个问题。 (由于外部原因,我必须使用 R3.4.0,但这可能是一个更好的主意 要安装更高版本,请参阅来自 R-Core 团队的 Uwe Ligges 的邮件 https://www.mail-archive.com/r-help@r-project.org/msg243256.html)

    【讨论】:

      猜你喜欢
      • 2021-07-30
      • 2013-10-29
      • 2011-01-24
      • 2021-07-30
      • 2018-06-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多