[R] execute an external program in R
Esam Tolba
eatolba at gmail.com
Thu Feb 14 14:59:18 CET 2013
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,
More information about the R-help
mailing list