Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate multiple RMarkdown outputs in RStudio

Not a duplicate: this question is about RStudio, not the R command prompt

I have an RMD file with two output formats in the header. However when I press "Knit" in RStudio, only the first output happens. Is this fixable?

Header:

---
title: "title"
output:
  html_document:
    css: style.css
    code_folding: hide
    dev: CairoSVG
    toc: yes
  github_document:
    df_print: kable
    toc: yes
---

Edit: It turns out the the "preview" version of RStudio allows you to pick which output you want. But outputting one will delete the other output.

like image 966
sharoz Avatar asked Dec 14 '25 06:12

sharoz


1 Answers

I didn't want to flag this post as a duplicate as you posted the question first. However, the answer was posted a few days later at the below link. I placed it here so others can find it if they land on your question.

Knit one markdown file to two output files

like image 69
Justin Avatar answered Dec 15 '25 19:12

Justin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!