I have a dataset where first column is a file name (in the working directory) and the second column is the directory to which I want the file to go. The dataset data2 looks like this:
[,1] [,2]
[1,] "Folder1/subfolder2/subfolder3" "File.Name1"
[2,] "Folder2/subfolder4/subfolder5" "File.Name2"
[3,] "Folder3/subfolder6/subfolder7" "File.Name3"
I tried to use the function file.copy as follows:
file.copy(from=data2[,2], to=data2[,1],
overwrite = TRUE, recursive = FALSE,
copy.mode = TRUE)
For which I get the warnings: cannot create file "Folder1/subfolder2/subfolder3", , reason 'No such file or directory'
. But there is such a directory. So, I have no idea what could be the problem.
New contributor
PabloSaint is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.