On 26/07/2019 2:37 a.m., Sigbert Klinke wrote:
im my package development I get the following error when checking an
> m <- findMatch('test', x[], FUN='leven(code)') %>% addWave(x[])
Error in findMatch("test", x[], FUN = "leven(code)") %>%
could not find function "%>%"
In my DESCRIPTION file I wrote
So, I expected that magrittr is loaded when the example is executed.
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:
If I add an "library(magrittr)" at the beginning of the example then the
example is okay.
Any ideas what goes wrong?
Remail@example.com mailing list