Am I missing something in the functions?
I want to copy a folder with some files and another subfolder from one location to another. I tried to use file.copy(from, to,
I'd rather write an R function that copies the directory using the Terminal. Here's what I use, but note that I wrote it only for Linux and OSX thus far.
dir.copy <- function(from, to) {
os <- Sys.info()['sysname']
if (os == "Darwin" || os == "Linux") {
command <- sprintf("cp -R '%s' '%s'", from, to)
system(command, intern = TRUE)
}
}
Quick, easy, and works like a charm.