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
unlink()
file.remove()
Maybe you're just looking for a combination of file.remove and list.files? Maybe something like:
file.remove
list.files
do.call(file.remove, list(list.files("C:/Temp", full.names = TRUE)))
And I guess you can filter the list of files down to those whose names match a certain pattern using grep or grepl, no?
grep
grepl