title: Argument/Parameter names in R - problems with local variables
body: <p>I have written many functions in R and I sometimes get issues with global and local variables. To be more precise, if I have the following global variables and function:</p>
  
  <pre><code># Defined before function, globally:
  ret &lt;- 0.12314
  fa &lt;- 789989.938
  
  prasx &lt;- function(ret, fa, ctry, arb, x = "4"){
  # do some stuff...
  return (yxc)
  }
  </code></pre>
  
  <p>Then I call the function via:</p>
  
  <pre><code>prasx(ret, fa, 'US', 3874.38) # OR
  prasx('US', 3874.38)  
  </code></pre>
  
  <p>I sometimes get errors. Obviously I think it happens if the global variables are not initialized after a workspace wipe. </p>
  
  <p>I'd like to know if this is a good way of writing functions in R, or if you would better use different argument/parameter names for functions than global variable names.
  Very often you just want to forward the global variable to the function; that's why I usually give them equal names. Also I guess it's always safer to avoid the below function call, without specifications?</p>
  
  <p>Thanks.</p>