title: How to create a sequential list of filenames in R
body: <p>I did a bibliometric analisys in R, using the Bibliometrix package. To start everything we need to use the readFiles command, which worked fine for me listing every file I needed. Something like this:</p>
  
  <pre><code>readFiles("file (1).txt", "file (2).txt", "file (3).txt")
  </code></pre>
  
  <p>Since we are talking about dozens of files for each analysis, I´ve tried to improve the code for future studies, doing something like:</p>
  
  <pre><code>FileName &lt;- "UniversityA"
  NumberofFiles &lt;- 80
  Files &lt;- paste0(FileName, " (", seq(1:NumberofFiles),").txt", collapse='","')
  readFiles(Files)
  </code></pre>
  
  <p>The idea is that "Files" would store a list like "UniversityA (1).txt", "UniversityA (2).txt, etc. With that, I could only change the name of the university in the analysis, and provide the total number of files to import the data. The problem is, when I try to read the list created, I get an error:</p>
  
  <pre><code>Error in file(con, "r") : could not open connection. 
  </code></pre>
  
  <p>I know that the problem is in the way the different elements are combined, since it works fine if I use a single file. I´ve tried many combinations on the collapse option, but all with the same problem, like:</p>
  
  <pre><code>collapse = '","'
  collapse = "\",\""
  </code></pre>
  
  <p>Can anyone think of a solution?</p>
  
  <p>Thanks,</p>
  
  <p>André</p>