I have datafile named dat1 I want to rename it to dat2 which I have stored in the object filename.
dat1 <- c(1:5) filename <- paste("dat2") If I use,
filename <- dat1 Then the dat1 is renamed to filename and not to dat2.
So how do I rename dat1 with the name stored in the object filename i.e. without mentioning dat2?
I tried using file.rename and mv but unsuccessful.