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

Jorgen Harmse JH@rm@e @end|ng |rom roku@com
Wed Jan 29 17:17:03 CET 2025


Hi Naresh Gurbuxani,

There are already several answers dealing with the specific code that you wrote, but my reaction is to step back a little.

R CMD � starts an R session but takes standard input from a file. (In Unix-like systems you might even be able to make an R script into an executable file.) I think it even uses the same .Rprofile as a regular R session. If there is a problem, you can paste the code a few lines at a time into a new ordinary R session. Then you can also set breakpoints (using debug, trace, or similar) in whatever functions you think caused the problem. You could also wrap all the code in a function and use the debugger to step through that (which may help if the error occurs in an iteration of a loop body).

Regards,
Jorgen Harmse.


Message: 1
Date: Mon, 27 Jan 2025 22:46:21 +0000
From: Naresh Gurbuxani <naresh_gurbuxani using hotmail.com>
To: "r-help using r-project.org" <r-help using r-project.org>
Subject: [R] R CMD check says no visible binding for global variable
Message-ID:
        <IA1P223MB0499637A346D65F7B4C2EA8CFAEC2 using IA1P223MB0499.NAMP223.PROD.OUTLOOK.COM>

Content-Type: text/plain; charset="utf-8"

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



	[[alternative HTML version deleted]]



More information about the R-help mailing list