We can add multiple authors to an R Markdown document within the YAML frontmatter in a number of ways. If we simply want to list them on the same line, we can provide a single string to the document, e.g.,

  1. ---
  2. title: "Untitled"
  3. author: "John Doe, Jane Doe"
  4. ---

Alternatively, if we wish each entry to be on its own line, we can provide a list of entries to the YAML field. This can be useful if you wish to include further information about each author such as an email address or institution, e.g.,

  1. ---
  2. author:
  3. - John Doe, Institution One
  4. - Jane Doe, Institution Two
  5. ---

We can make use of the Markdown syntax ^[] to add additional information as a footnote to the document. This may be more useful if you have extended information that you wish to include for each author, such as providing a contact Email and address. The exact behavior will depend on the output format:

  1. ---
  2. author:
  3. - John Doe^[Institution One, john@example.org]
  4. - Jane Doe^[Institution Two, jane@example.org]
  5. ---

Certain R Markdown templates will allow you to specify additional parameters directly within the YAML. For example, the Distill output format allows url, affiliation, and affiliation_url to be specified. After you install the distill package (Dervieux et al. 2023):

  1. install.packages("distill")

you can use the Distill format with detailed author information, e.g.,

  1. ---
  2. title: "Distill for R Markdown"
  3. author:
  4. - name: "JJ Allaire"
  5. url: https://github.com/jjallaire
  6. affiliation: RStudio
  7. affiliation_url: https://www.rstudio.com
  8. output: distill::distill_article
  9. ---

References

Dervieux, Christophe, JJ Allaire, Rich Iannone, Alison Presmanes Hill, and Yihui Xie. 2023. Distill: R Markdown Format for Scientific and Technical Writing. https://github.com/rstudio/distill.