R delete all files inside dir code example Example: r delete all files in folder unlink(directory_path, recursive = TRUE)