title: create a new column based on subtraction performed on another column
body: <p>i have a data set like this</p>
  
  <pre><code>    day   visibility
   1    01      10000
   2    02      15000
   3    03      15000
   4    04       6000
   5    07      15000
   6    08      15000
   7    09      15000
   8    12      10000
   9    13      15000
  10    20      10000
  11    31      10000
  12    01      10000
  13    02       5000
  </code></pre>
  
  <p>i want to create a new column <code>yesterday_visibility</code> such that it is <code>visibility[i]</code> if <code>day[i + 1] - day[i] == 1</code> else it is NA</p>
  
  <p>something like this </p>
  
  <pre><code>  day   visibility yesterday_visibility
   1    01      10000  NA
   2    02      15000  10000
   3    03      15000  15000
   4    04       6000  15000
   5    07      15000  NA
   6    08      15000  15000
   7    09      15000  15000
   8    12      10000  NA
   9    13      15000  10000
  10    20      10000  NA
  11    31      10000  NA
  12    01      10000  10000
  13    02       5000  10000
  </code></pre>
  
  <p>i tried this </p>
  
  <pre><code>mutate(data, yesterday_visibility = 
    for(i in 1:NROW(data$day)){
      ifelse((as.numeric(data$day[i + 1]) - as.numeric(data$day[i])) == 1, 
                                            data$visibility[i], NA )       
  })
  </code></pre>