title: How to obtain a logical (T/F) result when I reach the last row of data in r?
body: <p>I am looking to obtain a vector of T/F values based on whether I have reached the last row of data or not. I have attached an example data frame below.</p>
  <pre><code>df &lt;- structure(list(A = 1:24, B = 2:25), class = &quot;data.frame&quot;, row.names = c(NA, -24L))
  </code></pre>
  <p>Here is my desired output given the provided data.</p>
  <pre><code>c(&quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, 
    &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;F&quot;, &quot;T&quot;)
  </code></pre>
  <p>Would be great if this was a function similar to <code>is.na</code> such that I could include in an <code>ifelse</code> statement.</p>
  <p>i.e.,</p>
  <pre class="lang-r prettyprint-override"><code>df$new_variable &lt;- ifelse(if.last(df) == 'T' &amp; df$B == 25, 0, df$B)
  </code></pre>