Re: [R] sprintf in system command

2013-02-15 Thread Rui Barradas
Hello, In what follows I've used print(), not system(). The trick is to use paste0() to form the command. for (i in 1:10) { cmd <- paste0('C:/Users/.../dssp-2.0.4-win32.exe -i ', sprintf("data_%s.txt",i), ' -o ', sprintf("data_%s.dssp",i)) print(cmd) } Hope this helps, Rui Barrada

Re: [R] sprintf in system command

2013-02-15 Thread jim holtman
I think what you want is something like this system(sprintf('C:/Users/.../dssp-2.0.4-win32.exe -i data%d.txt -o data%d.dssp', i, i)) On Fri, Feb 15, 2013 at 12:33 PM, Esam Tolba wrote: > hi all > I am using r (2.15.2) in windows 7 32bit > I want to execute an external program from r console. th

[R] sprintf in system command

2013-02-15 Thread Esam Tolba
hi all I am using r (2.15.2) in windows 7 32bit I want to execute an external program from r console. the program is a command line program which needs the following format to start C:/Users/.../dssp-2.0.4-win32.exe -i data_1.txt -o data_1.dssp I used the system co