title: Merge two rows in a dataframe in R
body: <p>I am trying to merge rows in my <code>data.frame</code> based on <code>&lt;NA&gt;</code> value.</p>
  
  <p>Here is my data frame.</p>
  
  <pre><code>new &lt;- data.frame (
    Location = c(rep("Loc 1", 4), rep("Loc 2", 4)), 
    Place = c("Powder Springs_Original", "Bridge_Other County", "Airport", "County1", "City 4 - Duplicated", "South", "County2", "Formal place"), 
    Val1 = c(109, 123, NA, 117, 143, NA, 151, 142), 
    Val2 = c(102, 115, NA, 45, 135, NA, 144, 125), 
    Val3 = c(99, 112, NA, 26,  127, NA, 140, 132), 
    Val4 = c(90, 103, NA, 57, 125, NA, 135, 201))
  </code></pre>
  
  <p>I am expecting something like,</p>
  
  <pre><code>Location Place                      Val1 Val2 Val3 Val4
  Loc 1    Powder Springs - Original  109   102   99  90
  Loc 1    Bridge _ Other County      123   115  112  103
  Loc 1    Airport County1            117   45    26  57
  Loc 2    City 4 - Duplicated        143   135  127  125
  Loc 2    South County2              151   144  140  135
  Loc 2    Formal place               142   125  132  201
  </code></pre>
  
  <p>I want to remove the NA rows and merge data with the next row. Location for these values is same. Can someone please help me here.</p>
  
  <p>Thanks in advance.</p>