Open R Markdown in viewer pane

Viewed 6465

I'm rendering an R Markdown with parameters with the rmarkdown package' render function.

rmarkdown::render("file.Rmd", params = "ask")

It opens my default browser (Chrome) asking for the parameter input. I want it to open not in my default browser, but in the viewer pane. Or, alternatively in a different browser, like IE.

5 Answers

I think you are using RStudio. So go to Tools -> Global Options -> R Markdown.

In the shown dropdown menue you can change to viewer pane.

enter image description here

You can preview your file by using the shortcut shift + ctrl + k on rmarkdown::render("file.Rmd", params = "ask") (or shift + command + k for Mac).

EDIT: This will work if you change output preview to viewer pane in Global Options -> R Markdown do as described by @J_F

EDIT 2: Here is an image of the shortcut working in an .R document: enter image description here

I think the reason why you can't see it in your viewer pane is that you didn't choose the Knit to HTML. If you have already chosen the Knit to Pdf that will stay as a default so go to Knit and choose the Knit to HTML while making sure your preview is in Viewer Pane

Related