Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage of overlaps(), closest(), between(), and within() in join_by() triggers NOTE #6894

Closed
koenniem opened this issue Jul 25, 2023 · 1 comment

Comments

@koenniem
Copy link

I'm using the new helpers overlaps(), closest(), between(), and within() in the join_by() function in my CRAN package. However, when I run R CMD CHECK, it generates the following NOTE:

no visible global function definition for 'closest'

Normally I would evade such a note by either importing the function into my package, prefixing the namespace, or using the .data$ pronoun. None of these are possible, as dplyr::overlaps() doesn't exist (see also #6838) , and the .data$ pronoun clearly shouldn't be used and also doesn't work.

One possible workaround is defining the helpers in globalVariables,but as Hadley noted this is a "hideous hack", and I'd prefer to avoid it if possible.

How can these helpers be used in join_by() without triggering a NOTE during CRAN checks?

@DavisVaughan
Copy link
Member

The globalVariables() helper is fine to use here. We mention this here https://dplyr.tidyverse.org/articles/in-packages.html#join-helpers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants