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

[R-package] fixed NOTE about unrecognized global variable #2928

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

jameslamb
Copy link
Collaborator

This PR fixes a new R CMD CHECK note introduced in #2803 . See #2803 (comment) for background.

The note is:

* checking R code for possible problems ... NOTE
multiple.tree.plot.interpretation: no visible binding for global
  variable ‘bar_color’
Undefined global functions or variables:
  bar_color

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jameslamb Thanks!

I can say nothing about the approach itself, but can confirm that the issue is eliminated:

* checking R code for possible problems ... OK

@jameslamb
Copy link
Collaborator Author

@jameslamb Thanks!

I can say nothing about the approach itself, but can confirm that the issue is eliminated:

* checking R code for possible problems ... OK

thanks! The approach is the same we've taken for other references in data.table.

I use this approach in every R package that has non-standard evaluation like those that use data.table or ggplot2. It's something that prominent R developers recommend.

It's funny, if you look in the documentation for ?globalVariables in R (which ships with R by default), it literally says:

For globalVariables, the names supplied are of functions or other objects that should be regarded as defined globally when the check tool is applied to this package

So it's basically like using // NOLINT to suppress false positives from a linter.

Given all this, I think it's ok to merge without another review, assuming CI succeeds.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants