title: Unix Submission of R Script Batch Mode
body: <p>I am trying to run a R Script on a Linux server in Batch mode. The problem is with the last line of the code which throws an error which means that my R script is not going into execution. I tried a lot of variations to run my R script, but it has failed on every occasion. Here is the code </p>
  
  <pre><code>#PBS -r n
  #PBS -m bea
  #PBS -N Maha
  #PBS -M r2d2@gmail.com
  #PBS -l walltime=3:00:00
  #PBS -l procs=1
  cd $PBS_O_WORKDIR
  echo "Current working directory is `pwd`"
  R=/global/software/R-3.1.0-rh6/bin/R
  echo $R
  R --vanilla &lt; Maha.R
  </code></pre>
  
  <p>I also tried<br>
      R CMD BATCH Maha.R, source("Maha.R")
  Please help with this error.</p>