I wrote an R package, which is based on dplyr
. When I run the CMD check, an error pops up when evaluating the @examples.
could not find function "%>%"
Calls: Rresult
Execution halted
I have added dplyr
in the description file, and the package works well when I run the examples myself. I don't know where the problem is.
Here is part of my description file:
Imports:
stats,
utils,
dplyr
As a matter of fact, during CMD check, some notes on no visible binding for global variable
also appeared, which are related to dplyr
package. For instance
Rresult: no visible global function definition for ‘group_by’
Undefined global functions or variables:
group_by
I used following code to remove the notes:
group_by <- filter_at <- "%>%" <- NULL
Thanks a lot for your help
Add this to the script that contains the function(unless you imported the entire dplyr).
@importFrom magrittr "%>%"
If you intend to use dplyr
functions maybe explicitly call them like:
dplyr::group_by
dplyr::filter_at
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With