> # R script to create a dual-histogram ps file from a predict-2nd bychain files. > > # Usage: R --vanilla --quiet --args 'fname1' 'fname2' < bychain2dualhist.r >& R.bychain2dualhist.log > > # input file: fname1.by-chain > # input file: fname2.by-chain > # output file: fname1.fname2.by-chain.dualhist.pdf > > infile.bychain.suffix <- ".by-chain" > outfile.hist.suffix <- ".by-chain.dualhist" > > # find the fname arguments after --args > my.args <- commandArgs() > my.argnum <- which(my.args == "--args") > fname1 <- NULL > fname1 <- my.args[my.argnum+1] > fname2 <- NULL > fname2 <- my.args[my.argnum+2] > > if (!length(fname1)) { + print("Error: expecting --args 'fname1' 'fname2'") + quit() + } > > if (!length(fname2)) { + print("Error: expecting --args 'fname1' 'fname2'") + quit() + } > > infile1.prefix <- fname1 > infile2.prefix <- fname2 > outfile.prefix <- paste (fname1, fname2, sep=".") > > infile1.bychain <- paste (infile1.prefix, infile.bychain.suffix, sep="") > infile2.bychain <- paste (infile2.prefix, infile.bychain.suffix, sep="") > outfile.hist.ps <- paste (outfile.prefix, outfile.hist.suffix,".ps", sep="") > outfile.hist.pdf <- paste (outfile.prefix, outfile.hist.suffix,".pdf",sep="") > > > bychain1.data <- read.table( infile1.bychain, header=FALSE, as.is=TRUE) Error in file(file, "r") : unable to open connection In addition: Warning message: cannot open file `fname1.by-chain' Execution halted