# Copy all the files in a directory to a new directory using R

October 27, 2011
By

(This article was first published on PlanetFlux, and kindly contributed to R-bloggers)

Someone asked me how to move a directory full of files from one place to another using R.  The easiest way I've found is as follows (where "oldpath" is the existing directory and "newpath" is the new directory):

file.copy(list.files(oldpath),newpath)

Tags: