Possible Duplicate:
How can I read command line parameters from an R script?
I've got a R script for which I'd like to be able to supply several command-line parameters (rather than hardcode parameter values in the code itself). The script runs on linux.
I can't find out how how to read the R.script on the command line Bash.
sh file
cd `dirname $0`
/usr/lib64/R/bin/R --vanilla --slave "--args input='$1' input2='$2' output='$3'" file=/home/lvijfhuizen/galaxy_dist/tools/lisanne/partone.R $3.txt
R file
args <- commandArgs()
file <- read.csv(args[8],head=TRUE,sep="\t")
annfile <- read.csv(args[9],head=TRUE,sep="\t")