title: Get the number of lines in a text file using R
body: <p>Is there a way to get the number of lines in a file without importing it?</p>
  
  <p>So far this is what I am doing</p>
  
  <pre><code>myfiles &lt;- list.files(pattern="*.dat")
  myfilesContent &lt;- lapply(myfiles, read.delim, header=F, quote="\"")
  for (i in 1:length(myfiles)){
    test[[i]] &lt;- length(myfilesContent[[i]]$V1)
  }
  </code></pre>
  
  <p>but is too time consuming since each file is quite big.</p>