[R] DOS command using "system"

Taka Matzmoto sell_mirage_ne at hotmail.com
Thu Jan 26 19:35:27 CET 2006


HI R users
I have one question for using DOS command through "system"
I like to delete a file that is located at C:\Program 
Files\DOSPROGRAM\input.dat
I can use a DOS command "del" on Dos prompt like this

C:\Documents and Settings> del "C:\Program Files\DOSPROGRAM\input.dat"

to delete input.dat file.

When I try to do the same thing on R using "system" command

system('del "C:\Program Files\DOSPROGRAM\input.dat"')
or
system("del "C:\Program Files\DOSPROGRAM\input.dat"")
or
system(paste("del", "\"C:\\Program Files\\DOSPROGRAM\\input.dat\"",sep=" "))

All the three system commands did work

Could you help me to figure out ?

Thanks in advance

TM




More information about the R-help mailing list