Skip to content
Prev 4228 / 12125 Next

[R-pkg-devel] Example fails in check

On 26/07/2019 2:37 a.m., Sigbert Klinke wrote:
Loaded doesn't mean it is on the search list.  To get that you need 
library(magrittr), or require(magrittr).

Examples can't see things that are internal to the package.  Importing a 
package only makes it available internally.   If you want it visible 
externally (as it needs to be in an example), you need to export it.

So if you want users of your package to have access to magrittr pipes, 
you should put something like this in your NAMESPACE file, as well as 
the declaration in your DESCRIPTION file:

importFrom(magrittr, "%>%")
export("%>%")

Duncan Murdoch