File renaming using R
Given that you are in the right working directory (otherwise set it with setwd("")
, you can change file names with:
from1 <- c("test_file.csv", "plot1.svg")
to1 <- c("test.csv", "plot.svg")
file.rename(from1, to1)
But make sure that you are in the right directory and that the files exist (which you can do with list.files
or file.exists
.