parse(outFile)中的错误:输入意外结束-软件包安装中的错误以及如何修复 [英] Error in parse(outFile) : unexpected end of input - bug in package install, and how to fix

查看:65
本文介绍了parse(outFile)中的错误:输入意外结束-软件包安装中的错误以及如何修复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在尝试从GitHub安装我自己的软件包时,遇到了一个其他人已通知我的问题,但我尝试修复失败。我得出的结论是,软件包安装程序会误将问题源告知用户,从而导致无法正常搜索工作脚本中的错误。

In trying to install my own package from GitHub I hit a problem that others have notified me about and I'd tried unsuccessfully to fix. I conclude that the package installer misinforms the user about the problem source, leading to fruitless searching for faults in working scripts.

install_github("SimonDedman/gbm.auto", force = TRUE)

(屏幕截图使其正确排列)

(Screenshot so it lines up properly)

推荐答案

从逻辑上得出结论,问题出在...控制台说的是-该文件的末尾gbm.valuemap_oldbkup.R。但是我已经搜索了该文件。没关系。恢复为历史版本(因此为oldbkup文件名),也可以。但是:现在,它已经出现在gbm.valuemap_oldbkup.R中,而不是错误出现在gbm.valuemap.R中。区别?现在,Oldbkup是列表中的最后一个文件。因此,问题可能可能不在于此特定文件的方括号未闭合……而是先前任何文件中的方括号均未闭合。扩展邓肯·默多克的方法

One would logically conclude that the problem is... where the console says it is - the end of this file, gbm.valuemap_oldbkup.R. But I have scoured that file. It's fine. Reverted to a historical version (hence oldbkup filename) and that's fine too. BUT: instead of the error being in gbm.valuemap.R, now it's in gbm.valuemap_oldbkup.R. The difference? Oldbkup is now the last file in the list. So maybe the problem isn't that this specific file has an unclosed bracket... it's that there's an unclosed bracket somewhere in any of the previous files. Extending Duncan Murdoch's approach:

setwd("gbm.auto/R/") # goto package root
allfiles <- list.files() # list files
for (i in allfiles) {
  print(paste0(which(allfiles %in% i), "/", length(allfiles), " : ", i)) # counter
  text <- readLines(i)
  src <- srcfile(i)
  parse(text = text, srcfile = src)
}

我发现问题实际上出在gbm.auto中。 R.我搜索该文件,找到问题,进行修复,然后重试安装,效果很好。我将找出在哪里提交此错误(install_packages,R,RStudio等),并执行此操作。同时,希望这会对其他人有所帮助。

I find that the problem is actually in gbm.auto.R. I scour that file, find the problem, fix it, retry install, works fine. I'll find out where to file this bug (install_packages, R, RStudio, other) and do so. In the meantime, hopefully this helps others.

这篇关于parse(outFile)中的错误:输入意外结束-软件包安装中的错误以及如何修复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆