I came accross an issue when creating packages through the RStudio GUI. When we create a "clean package" like this:
The NAMESPACE file created will not be written by roxygen2 and comes out like this:
Causing an issue when invoking rextendr::document() which will make it skip writing the NAMESPACE file:
─ DONE (extendr)
✔ Writing 'R/extendr-wrappers.R'
ℹ Updating extendr documentation
ℹ Loading extendr
✖ extendr-wrappers.R:12: `@docType "package"` is deprecated.
ℹ Please document "_PACKAGE" instead.
✖ Skipping NAMESPACE
ℹ It already exists and was not generated by roxygen2.
This in turn will make it so the wrap objects are not exported when installing the package which will cause the error when trying to call the function:
Error in odsrust::hello_world() : object 'wrap___hello_world' not found
When creating the package using usethis::create_package(".") or the new rextendr project template this problem doesn't happen, due to the NAMESPACE file being written corretly by roxygen2 such as in the example below:
Hopefully this can help someone with the same issue as I had.
Hello!
I came accross an issue when creating packages through the RStudio GUI. When we create a "clean package" like this:![image](https://github.com/extendr/rextendr/assets/25166037/825d47bb-63af-4360-8bee-b6257e597800)
The NAMESPACE file created will not be written by roxygen2 and comes out like this:
Causing an issue when invoking
rextendr::document()
which will make it skip writing the NAMESPACE file:This in turn will make it so the wrap objects are not exported when installing the package which will cause the error when trying to call the function:
Error in odsrust::hello_world() : object 'wrap___hello_world' not found
When creating the package using
usethis::create_package(".")
or the new rextendr project template this problem doesn't happen, due to the NAMESPACE file being written corretly by roxygen2 such as in the example below:Hopefully this can help someone with the same issue as I had.
Thanks and congratulations on the project!