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: 

To leave a comment for the author, please follow the link and comment on his blog: PlanetFlux.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.