-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Rcpp packages FAILS when using roxygen2 to handle NAMESPACE (correction - this is not a bug - issue closed) #130
Comments
This is not a roxygen2 bug - you either need to use package skeleton or supply the correct roxygen2 tags. You can't do both. |
Thanks Hadley. p.s: the package was started using RStudio projects - where I asked for a package+Rcpp type project. But either way, this "feature" persists regardless. |
See the roxygen2 documentation: http://cran.r-project.org/web/packages/roxygen2/roxygen2.pdf The exportPattern is a global wildcard that exports all functions that start with an alpha character (excluding ones that e.g. start with .). With roxygen2 you would explicitly export functions using roxygen2 directives. Note that this also works for C++ functions. See this documentation: http://cran.rstudio.com/web/packages/Rcpp/vignettes/Rcpp-attributes.pdf |
Hello JJ, Just to be precise - I did not add "user created code" to the NAMESPACE.
Suggestions:
or, after another thought I hope what I'm saying makes sense... |
I think the core issue is that before using/enabling these tools you need to first understand a bit more about what they do and how they work. In particular, turning roxygen2 namespace editing on implies that:
I agree that some users will get hung up here, but better that users understand how to use the tools thoroughly in the first place rather than providing a crutch in the form of special case warnings or other "automagic" workarounds. |
Thanks JJ, I see some good comments where made here: I stand corrected about the "bug". |
Okay, glad you've got everything working now! On Saturday, August 17, 2013, Tal Galili wrote:
|
Remeber roxygen2 NAMESPACE editing is not compatible with Rstydui project+Rcpp as per r-lib/roxygen2#130 (comment)
If building an Rcpp package (using rcpp.package.skeleton will do),
And turning on:
build tools -> generate documentation with roxygen -> configure -> use roxygen to generate -> NAMESPACE files
Will cause roxygen to erase the following two ESSENTIAL lines from NAMESPACE:
useDynLib(PkgName)
exportPattern("^[[:alpha:]]+")
This will cause an error of the style:
Error in .Call("RcppDend_Rcpp_labels_dendrogram", PACKAGE = "RcppDend") :
"RcppDend_Rcpp_labels_dendrogram
" not available for .Call() for package "RcppDend"
I will also submit this report in the roxygen repo.
Thanks :)
Tal
The text was updated successfully, but these errors were encountered: