title: How to combine two RMarkdown (.Rmd) files into a single output?
body: <p>I have two files in the same folder: chapter1.Rmd and chapter2.Rmd, with the following content:</p>
  
  <p><strong>chapter1.Rmd</strong></p>
  
  <pre><code>---
  title: "Chapter 1"
  output: pdf_document
  ---
  
  ## This is chapter 1. {#Chapter1}
  
  Next up: [chapter 2](#Chapter2)
  </code></pre>
  
  <p><strong>chapter2.Rmd</strong></p>
  
  <pre><code>---
  title: "Chapter 2"
  output: pdf_document
  ---
  
  ## This is chapter 2. {#Chapter2}
  
  Previously: [chapter 1](#Chapter1)
  </code></pre>
  
  <p>How can I knit these so that they combine into a single pdf output?</p>
  
  <p>Of course, <code>render(input = "chapter1.Rmd", output_format = "pdf_document")</code> works perfectly but <code>render(input = "chapter1.Rmd", input = "chapter2.Rmd", output_format = "pdf_document")</code> does not. </p>
  
  <p>Why do I want to do this? To break up a <a href="https://github.com/Robinlovelace/spatial-microsim-book/blob/master/book-cambridge.Rmd" rel="noreferrer">giant document</a> into logical files.</p>
  
  <p>I've used @hadley 's <a href="https://github.com/hadley/bookdown" rel="noreferrer">bookdown</a> package to build latex from .Rmd but this seems like overkill for this particular task. Is there a simple solution using knitr/pandoc/linux command line I'm missing? Thanks.</p>