【发布时间】:2020-04-14 23:27:33
【问题描述】:
我正在整理一个包,但是我似乎没有找到让包在系统中找到二进制文件的方法,请注意下面的代码:
find_nim <- function(message=TRUE) {
nimexe <- ""
if (.Platform$OS.type == "unix") {
nimexe <- try(system2("which", "nim", stdout=TRUE))
if (message) message("Nim found at ", nimexe)
} else {
message("Unrecognized operating system.")
}
# if (nimexe=="") message("nim executable not found.\n Specify the location of your nim executable.")
return(nimexe)
}
这会在安装包时返回:
Warning in system2("which", "nim", stdout = TRUE) :
running command ''which' nim' had status 1
Nim found at
Error: package or namespace load failed for ‘nimrmarkdown’:
.onAttach failed in attachNamespace() for 'nimrmarkdown', details:
call: if (nimexe != "") {
error: argument is of length zero
相同的代码在 R 中本地工作。
- 在包开发中检查系统上的二进制文件的正确方法是什么?
【问题讨论】:
标签: r