god
god

Reputation: 297

suppress "Note: no visible global function definition for" in R

I'm using qplot from ggplot2 package in knitr to make plots for LaTeX. The problem is that there's some sort of extra check triggered which spits out multiple "Note" messages like:

Note: no visible global function definition for ’initFields’

Corresponding notes for variables could be suppressed using solution from In R, is it possible to suppress "Note: no visible binding for global variable"? but it doesn't seem to work for functions.

Ideally I would like to turn off this check globally or at least redirect those 'note' messages to stderr.

Upvotes: 1

Views: 1155

Answers (2)

Nishant Kachawa
Nishant Kachawa

Reputation: 85

I might be stating the obvious but why not enclose the calls to ggplot with a deactivation of the JIT compiler

An example would be:

invisible(enableJIT(3))
#Normal Code Here

invisible(enableJIT(0))

#GGPlot Code here

invisible(enableJIT(3))

I agree its a bit of a quick fix but helps me work around the problem in nearly all the cases

Upvotes: 1

YCR
YCR

Reputation: 4022

maybe with ggplot instead of qplot, with aes_string instead of aes, as suggested here:

How can I handle R CMD check "no visible binding for global variable" notes when my ggplot2 syntax is sensible?

Upvotes: 0

Related Questions