1

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.

Community
  • 1
  • 1
god
  • 306
  • 1
  • 2
  • 12
  • Whenever you cross-post a question, please include the link to the other place: https://github.com/yihui/knitr/issues/1047 so you will not divide the number of experts by two (hence higher chances of getting an answer). – Yihui Xie May 30 '15 at 02:41
  • God this is a massive pain, did you ever find a solution? – mdsumner Jul 24 '15 at 22:23
  • Kind of - in my case this was caused by enableJIT() with levels higher than 1. No general solution though. – god Jul 29 '15 at 09:22

2 Answers2

1

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

0

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?

Community
  • 1
  • 1
YCR
  • 3,794
  • 3
  • 25
  • 29
  • That would help **only** for notes about variables inside aes() but global variables are already taken care of by the workaround which I've linked to in my question. The problem is about notes on "global function" to which variable workaround is not applicable. – god May 29 '15 at 11:52