title: how to read the last line of a txt file in R
body: <p>I want to read the last line of a txt file by <code>readLines</code> in <code>R</code>, how can I achieve this?</p>
  
  <pre><code>con&lt;-file("test.txt","r")
  line&lt;-readLines(con,n=-1)
  cat(line,"\n")
  close(con)
  </code></pre>
  
  <p>the text file is as followed</p>
  
  <pre><code>3B1CHLH_PI210.PV       07-MAY-15 10:33:52.5       173.944       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:34:29.0       173.379       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:35:25.6       172.890       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:35:58.3       173.009       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:36:50.9       173.677       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:37:18.6       173.069       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:37:49.2       173.408       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:38:39.6       173.445       Good
  3B1CHLH_PI210.PV       07-MAY-15 10:39:12.5       173.445       Good
  </code></pre>
  
  <p>I can only get all the lines, but I only want to read the last line, is there any way in <code>R</code> like the <code>fseek</code> in <code>C</code></p>