title: Merging two rows of data in R based on rules
body: <p><a href="https://i.stack.imgur.com/4GlkV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4GlkV.png" alt="enter image description here"></a>I have merged two data frames using bind_rows. I have a situation where I have two rows of data as for example below:</p>
  
  <pre><code>Page Path                           Page Title             Byline      Pageviews 
  /facilities/when-lighting-strikes      NA                    NA           668
  /facilities/when-lighting-strikes   When Lighting Strikes  Tom Jones       NA
  </code></pre>
  
  <p>When I have these type of duplicate page paths I'd like to merge the identical page paths, eliminate the two NA's in the first row keeping the page title (When Lighting Strikes) and Byline (Tom Jones) and then keep the pageviews result of 668 from the first row. Somehow it seems that I need </p>
  
  <ol>
  <li>to identify the duplicate pages paths </li>
  <li>look to see if there are different titles and bylines; remove NAs</li>
  <li>keep the row with the pageview result; remove the NA row</li>
  </ol>
  
  <p>Is there a way I can do this in R dplyr? Or is there a better way?</p>