0

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

SOUser
  • 610
  • 1
  • 11
  • 25

1 Answers1

0

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

Waldi
  • 39,242
  • 6
  • 30
  • 78
  • Nice thanks @waldi! I just had to add a @title for it to work (it gave an error saying missing name and title) – SOUser Jun 08 '20 at 21:45
  • @SOUser It worked for me too. – Alien Oct 27 '21 at 01:24
  • @SOUser, I updated my answer to clarify what I meant by description of the package (AFAIK you won't need `@title` with this header) – Waldi Oct 27 '21 at 19:52