title: Find first and last observations of grouped data
body: <p>I am trying to group dataframe by Vel_ID column and if Velocity column is NA find first and last position of Vel_ID observation, or if is there only one observation find only first. 
  I will use first and last observations in next function.</p>
  
  <p>How the data looks like</p>
  
  <pre><code>df
  # Vel_ID  Velocity  
  # 1       160         
  # 2       NA         
  # 2       NA          
  # 4       10      
  # 4       10          
  # 6       NA        
  # 7       10         
  # 8       NA       
  # 8       NA           
  # 8       NA     
  </code></pre>
  
  <p>I think I could use rleid function, something like this:</p>
  
  <pre><code>df %&gt;% 
      group_by(gr = rleid(Vel_ID)) 
      %&gt;%  #find first and last observations position there, but only if Velocity is NA 
  </code></pre>
  
  <p>Thanks in advance for your help</p>