title: R match NA in a selection of columns based on the column name
body: <p>I have a dataset containing per month revenue per client : Underneath is a working minimal sample. (the real dataset runs over multiple years, all months and multple clients, but you get the picture.)</p>
  
  <pre><code>client &lt;-c("name1","name2","name3","name4","name5","name6")
  Feb2018 &lt;- c(10,11,NA,21,22,NA)
  Jan2018 &lt;- c(20,NA,NA,NA,58,NA)
  Dec2017 &lt;- c(30,23,33,NA,NA,NA)
  Nov2017 &lt;- c(40,22,75,NA,NA,11)
  df &lt;- data.frame(client,Feb2018,Jan2018,Dec2017,Nov2017)
  </code></pre>
  
  <p>My objective is to have our revenue split up between 'new','recurrent'&amp;'lost',
  by adding an extra column.</p>
  
  <p>That is : </p>
  
  <blockquote>
    <ul>
    <li>new : clients having some revenue in 2018 but none in 2017. (name4 &amp; name5)</li>
    <li>recurrent : clients having some revenue in 2017 &amp; 2018. (name1 &amp; name2)</li>
    <li>lost : clients having some revenue in 2017 but none in 2018. (name3 &amp; name6)</li>
    </ul>
  </blockquote>
  
  <p>I know how to use grep to select the column names, </p>
  
  <pre><code>df[,c('client',colnames(df[grep('2018$',colnames(df))]))]
  </code></pre>
  
  <p>I also know how to use is.na. but I'm really stuck in making the combination of having a selection on both the column name &amp; the existance of NA in the selected column.</p>
  
  <p>Seen I'm thinking in circles now for some hours now, I would appreciate some help.
  Thanks for reading. </p>