To delete a CSV file in R, you can use the file.remove()
function. This function is used to delete one or more files.
To delete a single CSV file named "file.csv" in the current working directory, simply run:
main.r24 chars2 lines
If you want to delete multiple files (CSV or other), you can pass a vector of file names to the file.remove()
function, like this:
main.r54 chars2 lines
Note that the file.remove()
function cannot delete a directory. If you want to delete a directory and all its contents, use the unlink()
function instead.
gistlibby LogSnag