To copy a CSV file in R, we can use the file.copy()
function. The function requires two arguments: the path of the original file and the path of the destination file.
main.r94 chars3 lines
For example, let's say we have a file called "data.csv" in our working directory, and we want to make a copy of it called "data_copy.csv" in the same directory. We can use the following code:
main.r51 chars2 lines
Note that file.copy()
can be used to copy any file type, not just CSV files.
gistlibby LogSnag