title: I want to create a new column in my database according to information from another database
body: <p>I have two separate databases (Database_1 and Database_2) I want to add the height profile from Database_2 to Database_1 as a new column in Database_1.</p>
  
  <pre><code>Database_1:
  
  Horse_type
  Stallion
  Race_horse
  Work_horse
  Work_horse
  
  Database_2:
  
  Horse_type   Height_profile
  Stallion     Large
  Race_horse   Medium
  Work_horse   Small
  Pure_breed   Huge
  </code></pre>
  
  <p>So far I've only tried to do this using a for loop.</p>
  
  <pre><code>for (row in 1:nrow(Database_1)) {
  
  if(Database_1$Horse_type == Database_2$Horse_type) {
  
  Database_1$New_Column &lt;- Database_2$height_profile
   }
  }
  </code></pre>
  
  <p>I expect the output:</p>
  
  <pre><code>Database_1:
  
  Horse_type   Height_profile
  Stallion     Large
  Race_horse   Medium
  Work_horse   Small
  Work_horse   Small
  </code></pre>
  
  <p>But the actual output is:</p>
  
  <p>"There were 50 or more warnings (use warnings() to see the first 50)"</p>