R CMD check tells me ‘no visible binding for global variable’

Today is definitely a lucky day!

Here is the solution to avoid the NOTE ‘no visible binding for global variable’ when running R CMD check.

Basically just add to the DESCRIPTION file of your package the following line (for instance after defining the license)

LazyData: yes

and add a line in the routine which calls the data.frame

e.g.

DATA                           # new line
P <- DATA[,"P"]
E <- DATA[,"E"]

In my case, that made the package checker happy!

Here is also an alternative solution.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s