1

I have a large function made of thousands of lines of code called multiple times. In order to make my code faster I did the following:

library(compiler)
enableJIT(1)

Each time I subset my datatable, I get the following error message: "Note: no visible binding for global variable"

Would it be fine to ignore this note? How can I remove it?

Added example following comments:

dt_2 a datatable is defined in the global environment

the following function is defined

 subset_dt = function(dt){

 dt_2 = dt[ , A ]

}

then I call

 subset_dt(dt_2)
Uwe
  • 41,420
  • 11
  • 90
  • 134
Fredkho
  • 518
  • 1
  • 5
  • 14
  • 3
    Why the CRAN tag? Is this code in a package you are submitting to CRAN, or is it just being run locally? Is it really an *error*, or is it just a *warning*? By "each time I subset my datatable", do you mean each time you call your function? (Is subsetting your data table what the function does?) Or, within the function, you subset the data table and get the error? Or you get the error after running `enableJIT`? Can you try to make a *minimal, reproducble* example? – Gregor Thomas May 14 '18 at 21:23
  • 1
    What you have presented does appear to be an error. In R errors ar called "Error". Warnings are called "Warnings", and this doesn't sound like either one. – IRTFM May 15 '18 at 00:03
  • 2
    I think it might be a valid CRAN tag because this Note appears during R CMD check in preparation for package submission. @Fredkho could have done a better job of describing the steps leading up to this whinge. https://github.com/tidyverse/magrittr/issues/29 – IRTFM May 15 '18 at 00:14

0 Answers0