Is there any way to automatically delete all files or folders with few R command lines?
I am aware of the unlink()
or file.remove()
functions, but for those you need to define a character vector with exactly all the names of the files you want to delete. I am looking more for something that lists all the files or folders within a specific path (e.g. 'C:/Temp') and then delete all files with a certain name (regardless of its extension).
Any help is very much appreciated!