title: How do I update data frame fields in R?
body: <p>I'm looking to update fields in one data table with information from another data table like this:</p>
  
  <pre><code>dt1$name &lt;- dt2$name where dt1$id = dt2$id
  
  In SQL pseudo code : update dt1 set name = dt2.name where dt1.id = dt2.id
  </code></pre>
  
  <p>As you can see I'm very new to R so every little helps.</p>
  
  <p><strong>Update</strong>
  I think it was my fault - what I really want is to update an telephone number if the usernames from both dataframes match. </p>
  
  <p>So how can I compare names and update a field if both names match?
  Please help :)</p>
  
  <pre><code>dt1$phone&lt;- dt2$phone where dt1$name = dt2$name
  </code></pre>