[R] copyING directories and files

2009-12-11 Thread Paul Evans
Hi, I am using the windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let me do this (something like the 'cp' command in UNIX)? I have looked at 'file.copy', but as the name implies I think it only copies one

Re: [R] copyING directories and files

2009-12-11 Thread Uwe Ligges
I'd use a shell() command to call xcopy or robocopy, or cp given you have some unix tools installed. Uwe Ligges Paul Evans wrote: Hi, I am using the windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let

Re: [R] copyING directories and files

2009-12-11 Thread Romain Francois
What about this as a start : dir.copy - function( source = getwd(), target ){ files - list.files( source, recursive = TRUE ) dirs - unique( gsub( /[^/]+$, , files[grepl(/, files)] ) ) if( !file.exists( target ) ){ dir.create( target )

Re: [R] copyING directories and files

2009-12-11 Thread Paul Evans
Thanks Romain, Uwe! From: Romain Francois romain.franc...@dbmail.com To: Uwe Ligges lig...@statistik.tu-dortmund.de Sent: Fri, December 11, 2009 5:35:57 AM Subject: Re: [R] copyING directories and files What about this as a start : dir.copy - function

Re: [R] copyING directories and files

2009-12-11 Thread Henrik Bengtsson
copyDirectory() in the R.utils package. /Henrik On Fri, Dec 11, 2009 at 1:01 AM, Paul Evans p.evan...@yahoo.com wrote: Hi, I am using the windows version of R. I wanted to copy a directory (containing several files) to another directory. Is there any command in R that will let me do this