Skip to content
Back to formatted view

Raw Message

Message-ID: <CAEPcxt3OjW9=j9RsOCgZNOW20RZs69Bzc07KEqKyOVQLu_=-eA@mail.gmail.com>
Date: 2013-02-14T13:59:18Z
From: Esam Tolba
Subject: execute an external program in R

Dear all
I am using r (2.15.2) under windows 7 32bit.
I want to use system command to execute an external program inside a
for loop. this program needs  the input and output names.
since the names will change in the for loop I am not able to use the
programs on all the files




for (k in 1:10){
        x=read.table ("data.txt")
       xx=x[1:5, ]
       xxx=paste0("data_",k,"txt")
     write.table (xx,xxx,quote =FALSE, sep = "\t",row.names = FALSE,
col.names = FALSE)
     system ('dssp.exe -i xxx -o xxx.out)

}







Best Regards,