title: Knitr:spin - how to add text without manually adding #' every line?
body: <p>My understanding is that <code>knitr:spin</code> allows me to work on my plain, vanilla, regular ol' good R script, while keeping the ability to generate a full document that understands markdown syntax. (see <a href="https://yihui.name/knitr/demo/stitch/" rel="nofollow noreferrer">https://yihui.name/knitr/demo/stitch/</a>)</p>
  
  <p>Indeed, the <code>rmarkdown</code> feature in <code>Rstudio</code>, while super neat, is actually really a hassle because </p>
  
  <ul>
  <li>I need to duplicate my code and break it in chunks which is super boring + inefficient as it is hard to keep track of code changes. </li>
  <li>On top of that <code>rmarkdown</code> cannot read my current workspace. This is somehow surprising but it is what it is.</li>
  </ul>
  
  <p>All in all this is <strong>very</strong> constraining... See here for a related discussion <a href="https://stackoverflow.com/questions/11155182/is-there-a-way-to-knitr-markdown-straight-out-of-your-workspace-using-rstudio">Is there a way to knitr markdown straight out of your workspace using RStudio?</a>. </p>
  
  <p>As discussed here (<a href="http://deanattali.com/2015/03/24/knitrs-best-hidden-gem-spin/" rel="nofollow noreferrer">http://deanattali.com/2015/03/24/knitrs-best-hidden-gem-spin/</a>), <code>spin</code> seems to be the solution.</p>
  
  <p>Indeed, <code>knitr:spin</code> syntax looks like the following:</p>
  
  <pre><code>#' This is a special R script which can be used to generate a report. You can
  #' write normal text in roxygen comments.
  #'
  #' First we set up some options (you do not have to do this):
  
  #+ setup, include=FALSE
  library(knitr)
  </code></pre>
  
  <p>in a regular workspace! </p>
  
  <p><strong>BUT</strong> note how each line of text is preceded by <code>#'</code>.</p>
  
  <p>My problem here is that it is also very inefficient to add <code>#'</code> after each single line of text. Is there a way to do so automatically? </p>
  
  <p>Say I select a whole chunk of text and rstudio adds this <code>#'</code> every row? Maybe in the same spirit as commenting a whole chunk of code lines?</p>
  
  <p>Am I missing something?</p>
  
  <p>Thanks!</p>