title: Why there are different behaviour between assignment symbol “=” and “<-” in R?
body: <p>I'm assigning values within the output list of a function, like:</p>
  
  <pre><code>nofun = function(sth){
  
  something happening here
  
  metrics = list(
  metric1 = value1
  metric2 &lt;- value2 )
  
  return(metrics)
  }
  </code></pre>
  
  <p>Once I query <code>metrics</code>, I noticed that the use of  <code>&lt;-</code> and <code>=</code> differs: the first ones only assigns the value to a variable with no name (i.e. <code>"x1"= value1</code>), while the second one applies also the correct name (i.e. <code>metric1 = value1</code>).</p>
  
  <p>This behaviour is cited also for <code>data.frame</code> at the bottom of an <a href="https://stackoverflow.com/questions/1741820/what-are-the-differences-between-and-in-r/1742550#1742550">old more generic question</a>, but there is no explanation of this specific usage case.</p>
  
  <p>It caused me quite many headaches and waste of time before noticing it, but I didn't find any other useful information.
  thanks in advance!</p>