4

Q: Why does the Knit drop-down in RStudio disappear when I add a knit option to the YAML header of my R Markdown file?

Normally I see the Knit button with drop-down option (like this knit01) when viewing a .Rmd in RStudio, . But the drop-down option disappears (so I only see enter image description here) after I add the following code to the YAML header in my .Rmd:

knit: (function(inputFile, encoding) {
  rmarkdown::render(inputFile, encoding = encoding, output_dir = "../output") })

I add that code because I want my output to go to a different directory than my source .Rmd.

I can change the ordering of my output fields (e.g., pdf_document, word_document) to Knit (without drop-down) to get a .pdf or .docx as I need. But go back and forth between the two often. So this work-around becomes very tedious.

This question appears to relate to What does “Knit HTML” do in Rstudio 0.98? and Knit Directory drop down menu.

tarleb
  • 19,863
  • 4
  • 51
  • 80
lowndrul
  • 3,715
  • 7
  • 36
  • 54
  • I don't currently have an answer, but it looks like this thread (https://github.com/yihui/knitr/issues/913) may be related to your issue. – Brad Cannell Dec 20 '17 at 17:46

0 Answers0