I'm creating a R package that contains Rcpp functions depending on RcppArmadillo, so I first generate the package skeleton by RcppArmadillo.package.skeleton
. However, when I roxygenize
my package, it gives me an error shown below.
R code
library(roxygen2)
library(RcppArmadillo)
library(Rcpp)
RcppArmadillo.package.skeleton(name = "prac_181206", example_code = FALSE)
roxygenize(package.dir = "prac_181206", roclets = "rd")
Error
Error in getDLLRegisteredRoutines.DLLInfo(dll, addNames = FALSE) :
must specify DLL via a “DLLInfo” object. See getLoadedDLLs()
After spending some time, I figured out this can be solved by removing .registration
option in NAMESPACE
file given as follows.
Original NAMESPACE file
useDynLib(prac_181206, .registration=TRUE)
importFrom(Rcpp, evalCpp)
exportPattern("^[[:alpha:]]+")
In short, after changing the first line above to useDynLib(prac_181206)
, it works fine, but I don't understand what the error means and why my solution works.
Could you anyone help me with this matter? I appreciate it!
Because this is a toy example, hopefully reproducible, I didn't include any other functions in man
or src
folders created by RcppArmadillo.package.skeleton
above.
FYI, the relevant information about my platform is
- Windows 7 x64
- R-3.5.1, Rstudio-1.1.423
- Rcpp-0.12.19, RcppArmadillo-0.9.100.5.0
- roxygen2-6.1.1