Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exported function not exported correctly

I am developing an R package (let's call it pkg), and I have defined a few generics. The NAMESPACE file contains both

S3method(foo, bar)
export(foo)

However, upon calling pkg::foo.bar, I get the dreaded

Error: 'foo.bar' is not an exported object from 'namespace:pkg'

I am using roxygen2, if that changes anything.

Note: If I explicitly add export(foo.bar), then everything works.

like image 782
JohnA Avatar asked Mar 16 '26 09:03

JohnA


1 Answers

NAMESPACE (and thus exports) is only updated when you run devtools::document() - not devtools::build() or devtools::install().

like image 55
its.me.adam Avatar answered Mar 19 '26 02:03

its.me.adam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!