24

I am converting my packages to use roxygen documentation, through the roxygen2 package. Now my package does not load and I think that is is because of the missing useDynLib(mypackage) call missing from the NAMESPACE file. How do I get this generated?

4
  • 7
    Off the top of my head is it @useDynLib xyz ? Commented Dec 7, 2011 at 2:32
  • yup. shame on my for not trying the obvious. Commented Dec 7, 2011 at 5:07
  • 1
    It wasn't totally obvious to me from the above (I guess it should have been) but that option needs to be added to the roxygen documentation entry for the package itself. This was helpful for me to see the example: ironholds.org/blog/… Commented Jan 11, 2017 at 16:37
  • The demo link appears to be broken, which is too bad because I also suffered from not knowing where to put the call Commented Feb 7, 2018 at 16:04

1 Answer 1

22

Start a package-level documentation file. In your example, R/mypackage.R that contains something like:

#' mypackage: A package for computating the notorious bar statistic. #' #' The mypackage package provides three categories of important functions: #' foo, bar and baz. #' #' @section Mypackage functions: #' The mypackage functions ... #' #' @docType package #' @name mypackage #' @useDynLib mypackage NULL #> NULL 

I also struggled for a bit to get .registration=TRUE. That is

#' @useDynLib mypackage, .registration=TRUE 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.