title: How to remove part of file name in R?
body: <p>I am using a function which produces pdf file. I use the following:  </p>
  
  <pre><code>file.rename(from = paste0(temp_dir, "/ratios.xlsx"), 
                  to = paste0(path, "/", format(Sys.time(), "%F"), 
                       "_", filename, " ", "RESULTS.xlsx")); 
  </code></pre>
  
  <p>the filename contains _TST which I do not want to have. </p>
  
  <blockquote>
    <p><strong>How can I take _TST away from the name of file?</strong></p>
  </blockquote>