powered by
Compared to file.rename file_move() always fails if it is unable to move a file, rather than signaling a Warning and returning an error code.
file_move()
file_move(path, new_path)
The new path (invisibly).
A character vector of one or more paths.
New file path. If new_path is existing directory, the file will be moved into that directory; otherwise it will be moved/renamed to the full path.
new_path
Should either be the same length as path, or a single directory.
path
.old_wd <- setwd(tempdir()) file_create("foo") file_move("foo", "bar") file_exists(c("foo", "bar")) file_delete("bar") setwd(.old_wd)
Run the code above in your browser using DataLab