[R-pkg-devel] no visible global function definition

Hadley Wickham h.wickham at gmail.com
Mon Jun 29 22:32:36 CEST 2015

> and available as an RSS feed.  (If you prefer Twitter, feel free to
> mirror the RSS feed there, if that's possible.  I don't use Twitter, so
> I won't do it.)  It seems to have become known here essentially
> immediately, so I'm not sure how an announcement would help.
> For the reasoning:  there's been a general trend to making sure packages
> work even when other packages don't use library() or require() to attach
> them.  This is a logical step in that direction.  If your function foo()
> uses the graphics plot() function but doesn't explicitly import it, then
> your function will fail if a user tries to run it while graphics isn't
> attached.  I suspect dispatch may also be faster if it is imported than
> if R has to search through everything on the search list.

Or it will fail in unexpected ways if the user has defined their own
plot method in the global environment.  This new check is an important
one to make sure you code works as expected, regardless of what else
is on the search path.



More information about the R-package-devel mailing list