To rename a csv file in R, you can use the file.rename()
function, which takes two arguments: the current file name, and the new file name. Here's an example code snippet that demonstrates how to rename a csv file:
main.r160 chars7 lines
In the above example, you would need to replace "old_file_name.csv"
and "new_file_name.csv"
with the actual names of the file you're working with.
Note that file.rename()
can also be used to move files to a different directory by specifying the new directory path as the new file name.
gistlibby LogSnag