Recursively document R package

0 Votes
    386 Views

I’m trying to build my first package with RStudio.

I already had a project with R files and I just changed the project layout like this:

.
|-R
|---File
|---Physics
|---Plot
|---Utils
|-man
|-vignettes
|-DESCRIPTION
|-NAMESPACE

My DESCRIPTION file contains the following text:

Package: my-package
Title: Package title
Version: 0.0.0.9000
Authors@R: person("Ben",
  "Me",
  email = "[email protected]",
  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. And when I use the Build/Document function in RStudio, it says:

==> 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.

If I Build&Reload the project, I have a No man pages found in package message.

So I guess the Document command was not applied correctly. If I put an R script with comments directly at the root of the R folder, it finds it. 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…)?

1

Answers


Please signup or login to answer this question.