[R] R CMD check says no visible binding for global variable

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Tue Jan 28 00:04:08 CET 2025


   This might be better for r-package-devel using r-project.org (since you're 
asking a question about package-checking).

   This is a common problem when using non-standard evaluation. 
Typically you can either use `utils::globalVariables` or set these 
variables to NULL near the top of your function.  There are arguments 
for either approach; I'm sure this has been discussed on r-package-devel 
before but I couldn't quickly locate a thread.

On 2025-01-27 5:46 p.m., Naresh Gurbuxani wrote:
> I have written a function which returns an SQL query result as a data.frame.  Each column of data.frame is a variable not explicitly defined.
> 
> For every column name, R CMD check says ‘no visible binding for global variable <name>. Status: 1 NOTE
> 
> Is it possible to tell R CMD check that these variables are OK?
> 
> Thanks,
> Naresh
> 
> Sent from my iPhone
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list