title: How to access the last value in a vector?
body: <p>Suppose I have a vector that is nested in a dataframe one or two levels.  Is there a quick and dirty way to access the last value, without using the <code>length()</code> function?  Something ala PERL's <code>$#</code> special var?</p>
  
  <p>So I would like something like:</p>
  
  <pre><code>dat$vec1$vec2[$#]
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>dat$vec1$vec2[length(dat$vec1$vec2)]
  </code></pre>