小编Hor*_*Tom的帖子

roxygen2 是否适用于 data-raw 中的 R 脚本?

我正在使用 RStudio 为我正在进行的数据分析创建一个包。为了将我的原始数据放入包中,我devtools::use_data_raw()按照本文使用。

我有一个脚本load-raw-data.R,可以加载原始数据并将其组装到数据帧中,然后调用devtools::use_data()该数据帧将其添加到包中。根据文章,load-raw-data.R不在 中/data-raw/R我已通过框架向该脚本中的函数添加了文档roxygen2,但是当我构建文档时,.Rd并未构建这些函数的文件。我认为这是因为 roxygen2 只查找/R. 有没有办法告诉也可以roxygen2查看?/data-raw或者我一路上误解了什么?

更新:遵循@phil的建议

@phil - 谢谢 - 我尝试了脚本中的其中一个函数 ( load_data_files) load-raw-data.R(请参阅下面添加到 R/data.R 的文档),但在重建包时出现错误:'load_data_files' is not an exported object from 'namespace:clahrcnwlhf'。我已将该@export标签包含在R/data.R. 关于如何解决这个问题有什么想法吗?

`# This script loads the individual component files of the raw dataset
# and stitches them together, saving the result as …
Run Code Online (Sandbox Code Playgroud)

r devtools rstudio roxygen2

5
推荐指数
0
解决办法
361
查看次数

标签 统计

devtools ×1

r ×1

roxygen2 ×1

rstudio ×1