title: R scoping: disallow global variables in function
body: <p>Is there any way to throw a warning (and fail..) if a global variable is used within a <code>R</code> function? I think that is much saver and prevents unintended behaviours...e.g.</p>
  
  <pre><code>sUm &lt;- 10
  sum &lt;- function(x,y){
  sum = x+y
  return(sUm)
  }
  </code></pre>
  
  <p>due to the "typo" in return the function will always return <code>10</code>. Instead of returning the value of <code>sUm</code> it should fail. </p>