很简单,写出你的代码,然后用system调用即可,有点像linux的echo。
我的一个例子:
myfasta = list.files(pattern="*.fa")
for (i in myfasta){
prefix<-strsplit(i, split = ".fa")[[1]][1]
command<-paste0("cd ",sof_dir," && python ./bin/CPC2.py -i ",data_dir,i," -o ",out_dir,prefix,".txt")
system(command)
}
网友评论