How can I rename a directory from R?
I tried:
Warning message:
In file.rename(from = sprintf("content/%s-content", pu_name), to = sprintf("content/%s", :
cannot rename file 'content/pu.train2-content' to 'content/train2', reason 'Directory not empty'
You could use shell
in order to pass an OS specific command to change it:
shell(paste('rename',
sprintf("content/%s-content", pu_name),
sprintf("content/%s", other_name)))
And it should work without needing an empty directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With