Search code examples
rpackagedevtoolsmanual

R package: author appearing in the manual


I m building a basic package with devtools (think of a package containing only an Hello World function).

My DESCRIPTION file is simply:

Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R: 
    person("Jon", "Snow", , "[email protected]", role = c("aut", "cre"),
           comment = c(ORCID = "YOUR-ORCID-ID"))
Description: What the package does (one paragraph).
License: `use_mit_license()`, `use_gpl3_license()` or friends to pick a
    license
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2

and I'm building it by running successively:
devtools::build(); devtools::install(); devtools::build_manual()

Everything works, but the manual never prints the `author', and I don't know how to make it work. It compiles without error... I tried this previous thread but it does not work.


Solution

  • I just tried the advice I originally gave, and it didn't work. Here's a modification.

    First, this is what happened with your code:

    devtools::build() builds the .tar.gz file for your package. It adds the Author field and some others to the DESCRIPTION file.

    devtools::install() is not really involved here.

    devtools::build_manual() ignores the .tar.gz file, and builds the manual using the source directory.

    Here's a way to fix it:

    devtools::install()
    devtools::build_manual(system.file(package="yourpackage"),
                           path = ".")
    

    This says to build and install the package, then using the copy that was installed, build the manual and output it to the current directory.

    This worked for me.