title: how to fill in empty data with data from another dataframe based on a column in R
body: <p>I have two separate data frames and I need to use the 'B' data frame to fill in empty values in the 'A' data frame.</p>
  <pre><code>A&lt;-data.frame(other=c('v','v','v','v','f','f'),
                site=c(1,2,3,4,5,6), 
                county=c('ab','bc','de','NA','NA','fg'), 
                stateprov=c(7,8,9,'NA','NA',10), 
                country=c('u','u','c','NA','NA','c'))
  
  B&lt;-data.frame(site=c(4,5), county=c('eh','gi'), 
                stateprov=c(11,12), country=c('u','u'))
  </code></pre>
  <p>#what I want</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>other</th>
  <th>site</th>
  <th>county</th>
  <th>stateprov</th>
  <th>country</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>v</td>
  <td>1</td>
  <td>ab</td>
  <td>7</td>
  <td>u</td>
  </tr>
  <tr>
  <td>v</td>
  <td>2</td>
  <td>bc</td>
  <td>8</td>
  <td>u</td>
  </tr>
  <tr>
  <td>v</td>
  <td>3</td>
  <td>de</td>
  <td>9</td>
  <td>c</td>
  </tr>
  <tr>
  <td>v</td>
  <td>4</td>
  <td>eh</td>
  <td>11</td>
  <td>u</td>
  </tr>
  <tr>
  <td>f</td>
  <td>5</td>
  <td>gi</td>
  <td>12</td>
  <td>u</td>
  </tr>
  <tr>
  <td>f</td>
  <td>6</td>
  <td>fg</td>
  <td>10</td>
  <td>c</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I'm not sure how fill in the NA's as join won't work in this case as far as I know.  Thanks for your help</p>