Jerwin Wieser
Jerwin Wieser

Reputation: 125

Open R Markdown in viewer pane

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.

Upvotes: 8

Views: 18958

Answers (5)

Maw
Maw

Reputation: 1

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

Upvotes: 0

joshuaosoro
joshuaosoro

Reputation: 1

Download RStudio Preview version. This version will enable you to preview your R Markdown in the viewer pane.

Upvotes: 0

user16609386
user16609386

Reputation: 76

Follow the instruction described by @J_F and click the Knit to HTML button. Preview will be displayed in the viewer pane. https://rmarkdown.rstudio.com/articles_integration.html

Upvotes: 6

ViviG
ViviG

Reputation: 1726

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

Upvotes: 3

J_F
J_F

Reputation: 10372

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

Upvotes: 10

Related Questions