system is one option, as it turns out, this is common enough that there are special functions for it, see ?file.copy
More generally, this is a great use of apropos: apropos("file") Shows a lot of options. An alternative work flow would be a shell script that runs r scripts and also interacts with the system (depending how much system interaction is needed). Cheers, Josh On Nov 1, 2011, at 19:42, Erin Hodgess <erinm.hodg...@gmail.com> wrote: > Dear R People: > > I have a variable named file1 which contains the name of a file. I > would like to copy that file to a different directory. Can I do that > via the system command or is there a better way, please? > > Thanks, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences > University of Houston - Downtown > mailto: erinm.hodg...@gmail.com > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.