adding useDynLib through Roxygen
Asked Answered
C

1

23

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?

Chak answered 6/12, 2011 at 22:13 Comment(4)
Off the top of my head is it @useDynLib xyz ?Vanzandt
yup. shame on my for not trying the obvious.Chak
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/…Inscrutable
The demo link appears to be broken, which is too bad because I also suffered from not knowing where to put the callEsdraelon
W
20

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
Wyler answered 19/3, 2020 at 3:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.