Search code examples
rroxygen2

R package DESCRIPTION not showing on?


Building an R package in RStudio roxygen2. Have these setting in Roxygen configure (below). However, after I build, I'm unable to see the nice documentation when trying:

> ?PackageName

It just gives:

No documentation for ‘PackageName’ in specified packages and libraries:

you could try ‘??PackageName’

The DESCRIPTION file is just a standard description file.

enter image description here


Solution

  • You have to create in the /R directory of the package a specific file containing the description of the package as well as @docType package and @name roxygen tags :

    #' MyPackageTitle
    #' 
    #' Description of MyPackage
    #'
    #' @docType package
    #' @name MyPackageName
    NULL
    

    NULL is necessary at the end, as no other object is defined here.

    This file usually has the name of the package : MyPackageName.R

    see http://r-pkgs.had.co.nz/man.html#man-packages