dreamRs / prefixer

Prefix function with their namespace & other development tools
GNU General Public License v3.0
142 stars 5 forks source link

Suggestion: expand the capability to include `.data$` in tidyverse pipes #9

Open jzadra opened 2 years ago

jzadra commented 2 years ago

Currently doing a build check produces lots of no visible binding for global variable [x]. Many of these are bare, unquoted column names in tidyverse pipe chains (see https://www.r-bloggers.com/2019/08/no-visible-binding-for-global-variable/), for instance:

mtcars %>%
mutate(cyl = cyl *2)

This will produce a build check warning of no visible binding for global variable 'cyl'.

The solution to avoid this is:

mtcars %>%
mutate(.data$cyl = .data$cyl *2)

I realize this is a bit more difficult ot determine where to put .data$, but it would be a nice feature.