roxygen2 not creating .Rd documentation

半腔热情 提交于 2019-12-08 17:35:55

问题


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 blocks initiated at the beginning of file with a #'

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

  3. Made sure there were no .Rd files in the 'man' folder

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', 'collate', 'namespace', 'vignette')) >

Updating MYPACKAGE documentation Loading MYPACKAGE Documentation completed

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source 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)

Edit: 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.


回答1:


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 

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") 

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



来源:https://stackoverflow.com/questions/42593278/roxygen2-not-creating-rd-documentation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!