2016-09-20 116 views
1

不是重複:這個問題是關於RStudio,不R命令提示產生多個RMarkdown輸出在RStudio

我有在頭兩個輸出格式的RMD文件。但是,當我在RStudio中按「編織」時,只會發生第一個輸出。這是可以修復的嗎?

頁眉:

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

編輯:原來,RStudio的「預覽」版本允許你選擇你想要的輸出。但輸出一個會刪除另一個輸出。

+0

它的行爲與記載的一樣。我認爲「fixable」意思是「可定製的」,而實現這一點的方法可能是通過在腳本中調用'rmarkdown :: render'並指定'output_format'參數。 – Gregor

+0

'output_format'的一個可能值是'「all」'。我想知道是否可以在RStudio中設置該值https://github.com/rstudio/rmarkdown/blob/2b25d39f1924f2b751cbf013cf8176baa96461b8/R/render.R#L30 – sharoz

+0

可能將[將一個markdown文件編碼爲兩個輸出文件] (https://stackoverflow.com/questions/39662365/knit-one-markdown-file-to-two-output-files) –

回答

0

我並不想將這篇文章標記爲duplicate,因爲您先發布問題。但是,答案在幾天後發佈在下面的鏈接上。我把它放在這裏,讓其他人可以找到它,如果他們着陸你的問題。

Knit one markdown file to two output files

+0

該解決方案不適用於RStudio。它僅用於R命令行。 – sharoz