roxygen2 不创建 .Rd 文档 [英] roxygen2 not creating .Rd documentation

查看:58
本文介绍了roxygen2 不创建 .Rd 文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法使用 RStudio 和 Roxygen2 为我的包生成 .Rd 文档文件.首先,让我提一下,我经历过这里发布的类似问题,并且已经完成了以下操作:

I am unable to generate .Rd documentation files for my package using RStudio and Roxygen2. First, let me mention that I have gone through similar problems posted here and have already done the following:

  1. Roxygen2 块在文件开头用 #' 启动

  1. Roxygen2 blocks initiated at the beginning of file with a #'

已配置的构建工具>使用 Roxygen 选中生成文档> 配置 > 选中使用 roxygen 生成"和运行时自动 roxygenize"下的所有字段

Configured Build Tools>Checked generate documentation with Roxygen> Configure > Checked all fields under 'Use roxygen to generate' and 'Automatically roxygenize when running'

即使在那之后,当我在 RStudio 上执行构建和重新加载"时,我会得到以下输出(请注意以下行:在包 MYPACKAGE 中找不到手册页:

And even after that, when I perform a 'Build and Reload' on RStudio I get the following output (please note the line that reads: No man pages found in package MYPACKAGE:

==> devtools::document(roclets=c('rd', 'collat​​e', 'namespace', 'vignette'))>

= => devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette')) >

更新 MYPACKAGE 文档加载我的包裹文档已完成

Updating MYPACKAGE documentation Loading MYPACKAGE Documentation completed

==> Rcmd.exe 安装 --no-multiarch --with-keep.source MYPACKAGE

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source MYPACKAGE

  • 安装到库 C:/Users/user/Documents/R/win-library/3.3
  • 正在安装源代码 包MYPACKAGE"...** R** 数据* 将数据集移动到延迟加载数据库** 为延迟加载准备包在包MYPACKAGE"中找不到手册页** 帮助* 安装帮助索引** 构建包索引** 测试是否可以加载已安装的包
  • 完成(我的包裹)
  • installing to library C:/Users/user/Documents/R/win-library/3.3
  • installing source package 'MYPACKAGE' ... ** R ** data * moving datasets to lazyload DB ** preparing package for lazy loading No man pages found in package 'MYPACKAGE' ** help * installing help indices ** building package indices ** testing if installed package can be loaded
  • DONE (MYPACKAGE)

经过进一步调查,这似乎是因为我的 R 目录中有子目录,默认情况下不支持.一个可能的解决方案位于这里,但是,我还没有尝试过.我将在能够进行测试后立即报告结果.

Upon further investigation, it appears that this was caused by the fact that I have sub-directories within my R directory, which is not supported by default. A possible solution was located here which, however, I haven't yet tried out. I will report back with the outcome as soon as I am able to perform the tests.

推荐答案

我遇到了同样的错误.roxygen2 在/man 目录中正确创建了 md 文件,但在编译时找不到它们.我有以下错误.

I had the same error. roxygen2 was creating correctly the md files in the /man directory but they were not found at compilation time. I had the following error.

No man pages found in package 

一段时间后,我发现在其中一个 R 文件中,我有一个源语句

After a bit of time I found that in one of the R file I had a source statement

source("C:/Users/vaulot/Google Drive/Scripts/R library/dv_function_pr2.R") 

我的猜测是源文件中有一些代码干扰了 roxygen2.

My guess is that there was some code in the source file interfering with roxygen2.

这篇关于roxygen2 不创建 .Rd 文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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