4
votes

When using ggplot or subset, a R CMD check command on my package generates the following notes:

* checking R code for possible problems ... NOTE
foo: no visible binding for global variable ‘bar’

for a mock function such as

foo <- function(dataframe) { subset(dataframe,bar>10) }

That R CMD check section is useful when forgetting about the usage of global variables in a package. Therfore I'd like to have it clean.

Is there a possibility to let R know of the special nature of ggplot/subset?

1
For the record, that had happened to me too on a simple (with(foo, subset(...)) or similar, so it has nothing to do with ggplot2 per se. I had meant to report it on r-devel but then I must have gotten distracted). Seems like a bug in tools to me. - Dirk Eddelbuettel

1 Answers

2
votes

That's the reason that this is a NOTE not a WARNING or ERROR - there's currently no automated way to detect the use of non-standard evaluation in a function.