title: R data.table ':=' works in direct call, but same function in a package fails
body: <p>Using R's data.table package,</p>
  
  <p>This works:</p>
  
  <pre><code>instruction = "a = data.table(name=1:3, value=1:3, blah=1:3); a[,c('value', 'blah'):=NULL]"
  eval(parse(text=instruction))
  #   name
  #1:    1
  #2:    2
  #3:    3
  </code></pre>
  
  <p>This works:</p>
  
  <pre><code>myFunc = function(instruction) {
  eval(parse(text=instruction))
  }
  myFunc(instruction)
  #   name
  #1:    1
  #2:    2
  #3:    3
  </code></pre>
  
  <p>Now, put this function into a package, load it, and try to call it. This doesn't work:</p>
  
  <pre><code>myFuncInPackage(instruction)
  #Error in `:=`(c("value", "blah"), NULL) : 
  #  Check that is.data.table(DT) == TRUE. Otherwise, := and `:=`(...) are defined for use in j, once only and in particular ways. See help(":=").
  </code></pre>
  
  <p>Why?</p>
  
  <hr>
  
  <p>EDIT: @Roland points out that adding data.table in the package <code>Depends</code> field makes it work. However, I don't think this is a great solution because the package doesn't really depend on, require, or use data.table. I just want to be able to use data.table with the package.</p>
  
  <p>In addition, everything else with data.table works fine in the function, just not the <code>:=</code> operator.</p>
  
  <p>So I guess a followup question could be: should I add data.table to the Depends of every package I write, so that data.tables work as expected within functions of that package? This doesn't seem right... what is the correct way to approach this?</p>