title: Fill up missing values using the other data?
body: <pre><code>A &lt;- data.frame(Item_A = c("00EF", "00EF", "00EF", "00EF", "00EF", "00FR", "00FR"),  
                  Item_B = c(NA, NA, NA, NA, "JAMES RIVER", NA, NA))
  
  B &lt;- data.frame(Item_A = c("00EF", "00EF", "00EF", "00FR", "00FR"), 
                  Item_B = c("JAMES RIVER", NA, "JAMES RIVER",
                             "RICE MIDSTREAM", "RICE MIDSTREAM"))
  </code></pre>
  
  <p>Expected:</p>
  
  <pre><code>A &lt;- data.frame(Item_A = c("00EF", "00EF", "00EF", "00EF", "00EF", "00FR", "00FR"),  
                  Item_B = c("JAMES RIVER", "JAMES RIVER", "JAMES RIVER", 
                           "JAMES RIVER", "JAMES RIVER", "RICE MIDSTREAM", "RICE MIDSTREAM"))
  
  B &lt;- data.frame(Item_A = c("00EF", "00EF", "00EF", "00FR", "00FR"), 
                  Item_B = c("JAMES RIVER", "JAMES RIVER", "JAMES RIVER", 
                             "RICE MIDSTREAM", "RICE MIDSTREAM"))
  </code></pre>
  
  <p>I have to fill in item <code>Item_B</code> according to the <code>Item_B</code> of other rows where <code>Item_A</code> is the same. For example, the first to fourth observation of <code>Item_B</code> in data set <code>A</code> need to become "JAMES RIVER". </p>
  
  <p>Can you please suggest a way to fill in the missing values in R? I tried many techniques but couldn't get what I wanted. </p>