While testing the code of a package with R CMD check the following NOTE appears for every variables used inside dplyr functions using non standard evaluation: " no visible binding for global variable ..."
For example if I used
cars %>% mutate(speedplusone = speed +1)
R CMD check would give the NOTE:
no visible binding for global variable speed
The question of removing these notes has been asked already and there is a reply by Hadley giving the option to either rewrite calls using standard evaluation or to fake the existence of those variable with a call to globalVariables()
.
According to Hadley's answer, I can remove those R CMD Check notes by using standard evaluation, replacing mutate
by mutate_
:
cars %>% mutate_(speedplusone = ~speed +1)
Should I rewrite all dplyr function calls in the package to avoid non standard evaluation completely?