title: how do you loop over a global variable in Sweave
body: <p>I have a big Sweave file with a variable called "specialty" near the top. The rest of this file is Latex and R, and uses this variable.</p>
  
  <p>How can I loop over various values for "specialty"?</p>
  
  <p>Two possibilities are:</p>
  
  <ol>
  <li>Make the file be one big loop (and convert the Latex parts to R).</li>
  <li>Write a script that copies the Sweave file, replace the value of "specialty", and run Sweave on each copy.</li>
  </ol>
  
  <p>Can you comment on these ideas, or suggest better ones?</p>