I can get it to work when the line looks like this: system(paste("./preproc_report -f", opt$samplesFile,"-c",Clean_Folder,"-d",Final_Folder,sep=" "))