Re: [R] question about "system" command

From: Austin, Matt <>
Date: Thu 26 Jan 2006 - 16:54:50 EST

Something like this.

See ?formatC, ?paste

for (i in 1:100)

    system(paste("C:\\Progra~1\\DOSPROGRAM\\RUN.exe input",

                  formatC(i, digits=2, flag='0'),


Amgen, Inc

-----Original Message-----
[]On Behalf Of Taka Matzmoto Sent: Wednesday, January 25, 2006 9:31 PM
Subject: [R] question about "system" command

Hi R Users
I am going to write a very short script for my small pilot simulation study. I need to call a DOS program with different input data files in the middle of for loop.
There are 100 input data files (e.g., input001.dat, input002.dat, .... , input100.dat)

for (1 in i :100)

    system('"C:\\Program Files\\DOSPROGRAM\\RUN.exe" input001.dat') }

I like to change the input data file name as for loop runs. How can I do that ?

Thanks in advance

TM mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Thu Jan 26 17:02:19 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:11 EST