title: How can I submit a batch job knitting an Rscript on LSF?
body: <p>How to knit an Rmd document in a job on an LSF cluster?</p>
  
  <p>I tried this:</p>
  
  <pre><code>bsub -q normal -E 'test -e /nfs/users/nfs_c/username' -R "select[mem&gt;20000] rusage[mem=20000]" -M20000 -o DOWNLOAD.o -e DOWNLOAD.e -J DOWNLOAD Rscript -e "rmarkdown::render('code/12downloadSeq.Rmd')"
  </code></pre>
  
  <p>The above command does not work. I get the following error:</p>
  
  <pre><code>Error in strsplit(version_info, "\n")[[1]] : subscript out of bounds
  Calls: &lt;Anonymous&gt; ... pandoc_available -&gt; find_pandoc -&gt; lapply -&gt; FUN -&gt; get_pandoc_version
  Execution halted
  </code></pre>
  
  <p>On the other hand, a script like the following to run a normal R script works:</p>
  
  <pre><code>bsub -q normal -E 'test -e /nfs/users/nfs_c/cr7' -R "select[mem&gt;20000] rusage[mem=20000]" -M20000 -o RSCRIPT.o -e RSCRIPT.e -J RSCRIPT Rscript code/setup.R
  </code></pre>
  
  <p>I imagine there is a problem with the quotation marks but I do not know how to solve it.</p>