Issues with roxygen2 - function not exported to NAMESPACE even after using @export

1,477 views
Skip to first unread message

rospa

unread,
Oct 24, 2016, 10:42:03 AM10/24/16
to devtools
I am building a package and get an error, saying that a function is not an exported object of the package. In the R script, I have used @export tag to export the function, however when I roxigenise using document() or roxygen() the function is not exported to the NAMESPACE (the Rmd file for that function is created though)

John Dolinka

unread,
Mar 9, 2018, 12:02:06 PM3/9/18
to devtools
I to have observed this as well and have the same question.  Thank you for mentioning this.  I will monitor thread for replies too.

Hadley Wickham

unread,
Mar 9, 2018, 1:52:25 PM3/9/18
to rospa, devtools
Not much we can do to help without seeing your code. A reproducible example would be very helpful. 

Hadley


On Monday, October 24, 2016, rospa <rpar...@gmail.com> wrote:
I am building a package and get an error, saying that a function is not an exported object of the package. In the R script, I have used @export tag to export the function, however when I roxigenise using document() or roxygen() the function is not exported to the NAMESPACE (the Rmd file for that function is created though)

--
You received this message because you are subscribed to the Google Groups "devtools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdevtools+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
http://hadley.nz

Victor Ordu

unread,
Mar 17, 2018, 10:21:16 AM3/17/18
to devtools
I had a similar experience yesterday while trying to build a package, and could only rectify it after deleting NAMESPACE, calling load_all() and then running document() again.

Mikey T

unread,
Jan 2, 2020, 3:17:45 PM1/2/20
to devtools
I am having the same problem with my R package. I think the problem arises when I try to use functions from my package in the Shiny functions that I've developed as part of the package. My package is here (https://github.com/mikeyEcology/MLWIC2) although you currently can't install it because of this issue. When I try to run `roxygen2::roxygenize()`, I get the error: "Error: 'setup_and_classify' is not an exported object from 'namespace:MLWIC2'"


On Monday, October 24, 2016 at 10:42:03 AM UTC-4, rospa wrote:

Gábor Csárdi

unread,
Jan 2, 2020, 4:08:57 PM1/2/20
to Mikey T, devtools
If I clone your repo, and run `roxygen2::roxygenize()` in it with
roxygen2 7.0.2, then everything seems to work fine.

Gabor
> --
> You received this message because you are subscribed to the Google Groups "devtools" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rdevtools+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rdevtools/4b2ba5d8-3adc-40cd-b5c4-f003890cbe74%40googlegroups.com.

Mikey Tabak

unread,
Jan 2, 2020, 4:18:36 PM1/2/20
to Gábor Csárdi, devtools
Thank you Gabor! I updated roxygen2 and it is working now.
Reply all
Reply to author
Forward
0 new messages