title: R - file.remove() by filetype
body: <p>I am using the following code to remove all generated .json temp files in my project:</p>
  
  <pre><code>file.remove(list.files(pattern = ".json"))
  </code></pre>
  
  <p>Is there a more simple way to achieve it without nesting functions?</p>