[英]Recursively document R package
I'm trying to build my first package with RStudio. 我正在尝试使用RStudio构建我的第一个软件包。
I already had a project with R files and I just changed the project layout like this: 我已经有一个带有R文件的项目,而我只是这样更改了项目布局:
.
|-R
|---File
|---Physics
|---Plot
|---Utils
|-man
|-vignettes
|-DESCRIPTION
|-NAMESPACE
My DESCRIPTION file contains the following text: 我的DESCRIPTION文件包含以下文本:
Package: my-package
Title: Package title
Version: 0.0.0.9000
Authors@R: person("Ben",
"Me",
email = "my@email.com",
role = c("aut", "cre"))
Description: blabla
Depends:
R (>= 3.3.2)
License: file LICENSE
Encoding: UTF-8
LazyData: true
VignetteBuilder: knitr
Suggests:
knitr,
rmarkdown
RoxygenNote: 5.0.1
All my functions contain roxygen comments. 我所有的功能都包含roxygen注释。 And when I use the Build/Document function in RStudio, it says:
当我在RStudio中使用Build / Document函数时,它说:
==> devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette'))
Updating my-package documentation
Loading my-package
Writing NAMESPACE
Updating vignettes
Documentation completed
But the man pages and the NAMESPACE file remain empty. 但是手册页和NAMESPACE文件保持为空。
If I Build&Reload the project, I have a No man pages found in package
message. 如果我生成并重新加载该项目,则
No man pages found in package
消息中No man pages found in package
。
So I guess the Document command was not applied correctly. 所以我猜Document命令没有正确应用。 If I put an R script with comments directly at the root of the R folder, it finds it.
如果我将带有注释的R脚本直接放在R文件夹的根目录下,它将找到它。 Is there a way to make RStudio explore recursively all my code folders or should I just put all my files at the root of the R folder (which is cumbersome for someone coming from the Java world...)?
有没有办法让RStudio递归浏览我的所有代码文件夹,还是我应该将我的所有文件放在R文件夹的根目录下(这对于来自Java世界的人来说很麻烦...)?
R documentation states that only the following folders are allowed (and have their own functions): R文档指出仅允许以下文件夹(并且它们具有自己的功能):
The man subdirectory may contain a subdirectory named macros ;
man子目录可能包含一个名为macros的子目录; this will contain source for user-defined Rd macros.
这将包含用户定义的Rd宏的源。 (See User-defined macros.) These use the Rd format, but may not contain anything but macro definitions, comments and whitespace.
(请参阅用户定义的宏。)这些宏使用Rd格式,但除了宏定义,注释和空格外,可能不包含任何其他内容。
The R and man subdirectories may contain OS-specific subdirectories named unix or windows .
R和man子目录可能包含名为unix或windows的特定于操作系统的子目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.