3

This is my first time building an R package, and doing it with the help of devtools and roxygen2. After writing a simple func in the R directory and making a DESCRIPTION file with devtools, I try to build and reload for the first time but I get an error -

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

First time using roxygen2 4.0. Upgrading automatically...

Documentation completed

==> R CMD INSTALL --no-multiarch --with-keep.source TestPack

...

ERROR: a 'NAMESPACE' file is required

Which is odd because I have selected in my build configurations that roxygen2 should be making this for me. A man directory is made when building and reloading but nothing else.

Community
  • 1
  • 1
  • 2
    just create a blank NAMESPACE file. on the command line e.g., `touch NAMESPACE` then rerun `document()` – sckott May 01 '15 at 05:52
  • If your simple function does not require any imports and is not exported it may be that the file is not created. – Bryan Hanson May 01 '15 at 08:05
  • Thanks @ScottChamberlain I can make a blank NAMESPACE and then it works fine. I was thinking I didn't have to do that. – Scott Funkhouser May 01 '15 at 12:21
  • yeah, i don't understand why that happens, i guess its conservative about making changes to your files, though i'd think if a namespace file didn't exist, it is a safe thing to create one – sckott May 01 '15 at 16:55
  • Somehow, i had the same problem and I figured out that after a crash of my Rstudio, it had automatically unselected all the build options for roxygen2, that was the reason of the error. – agenis Apr 01 '19 at 17:38

0 Answers0