devtools :: document尝试以文件形式打开目录

问题描述 投票:0回答:1

我正在尝试使用devtools::document()为R软件包构建手册文件。但是,当我从包装内调用document()时,会得到以下信息:

Updating xpcaR documentation
Loading xpcaR
Error in file(con, "r") : cannot open the connection
Calls: suppressPackageStartupMessages ... roxy_tag_rd.roxy_tag_example -> read_lines -> <Anonymous> -> file
In addition: Warning messages:
1: In file(con, "r") :
  'raw = FALSE' but '/Users/andersonberg1/Documents/GitLab/xpcar/xpcaR/' is not a regular file
2: In file(con, "r") :
  cannot open file '/Users/andersonberg1/Documents/GitLab/xpcar/xpcaR/': it is a directory
Execution halted

Exited with status 1.

警告是完全正确的:.../xpcaR/是目录,而不是文件。实际上,这是我呼叫document()时所在的目录。为什么要尝试以文件形式打开目录?

我当前的想法是由于某种原因,它正在寻找某个文件名,出现空白,等等。>

full_filename = paste0(path2package, filename)

filename为NULL,因此仅以包的路径结尾。但是,我不知道为什么会这样。

我正在尝试使用devtools :: document()构建R包的手册文件。但是,当我从程序包内部调用document()时,得到以下信息:更新xpcaR文档正在加载xpcaR ...

r devtools
1个回答
0
投票

我意识到问题是我正在写#' @example,但尚未填写该字段。简而言之

© www.soinside.com 2019 - 2024. All rights reserved.