Using roxygen2
, how do I specify .registration = TRUE
for @useDynLib
? I tried:
@useDynLib rmongodb .registration=TRUE
but then I end up with
useDynLib(rmongodb,".registration=TRUE")
in the NAMESPACE
file, i.e. it quotes the input to make it a single argument.
Alternatively, is there some way to just add some raw text to NAMESPACE
when it's being managed by roxygen
?
Any guidance for this? I'm trying to roxygenize the rmongodb
package, but this seems to be a blocker.
It's not currently possible, sorry :( If I get a chance to work on roxygen3 soon, this will be included.
One workaround I've found is to turn on namespace support in RStudio, build & let it fail, then turn off namespace support and go hand-edit the NAMESPACE
file. Repeat whenever namespace changes are made.
I wonder if we should have @namespace
or similar that allows you to insert arbitrary text into the NAMESPACE
I think I'm going to take a different approach - if there's a comma in the tag value, I'll keep everything as is and not do any escaping. Then you'd just do @useDynLib rmongodb, .registration=TRUE
Perhaps this could be stated somewhere more prominently in roxygen's documentation? I read various short and extended guides, but didn't find this until now (perhaps I just got unlucky, or had potatoes on my eyes =)). It's an issue that will come for anyone working on libraries that involve stan/rstan, for example.
FWIW it is in the manual, here: https://roxygen2.r-lib.org/articles/namespace.html#imports
But if you have a suggestion to improve it, we can certainly do that.
In general it is often useful to search how other packages do it, e.g. https://github.com/search?q=org%3Acran+useDynLib+registration&type=Code
Thank you - I think I must have read an older manual. My mistake!
Most helpful comment
I think I'm going to take a different approach - if there's a comma in the tag value, I'll keep everything as is and not do any escaping. Then you'd just do
@useDynLib rmongodb, .registration=TRUE