[R] Delete files from R

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue May 13 13:11:41 CEST 2003


On Tue, 13 May 2003, "Unternährer Thomas, uth" wrote:

> I have a file: d:\foo.txt and want to delete this.
> 
> I tried: 
> system("del d:/foo.txt") works not
> system("notepad d:/foo.txt") works
> 
> Is it possible that I can't delete files or do I have misunderstood something?
> 
> (del is a DOS-command. The "string works" under DOS "\")

And your OS appears to be *Windows* not DOS!

You could try ?shell to see how to run a shell and its commands.
However, ?unlink would be more profitable.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list