Rmarkdown directly to browser


#1

Hi folks,
Looking for help with my work flow.
I have an Rmd file with shiny components inside.
I'd like to "Run Document" directly to the browser, bypassing the viewer,
since the layout in viewer is so different that the viewer is useless.
Same as you would achieve with runApp("launch.browser = TRUE") if it were shiny at the top level.
I tried writing a few lines using rmarkdown::render(runtime='shiny') and browseURL()
but the shiny parts throw errors, and my embedded TeX is not processed.
Ideas welcome!


#2

Try this:

out_path <- rmarkdown::render("path/to/document.Rmd")
browseURL(out_path)

#3

Thanks. Did that. It works, as far as it goes, but not far enough.
... "the shiny parts throw errors, and my embedded TeX is not processed".
That's my issue.


#4

Here's the solution:

rmarkdown::run("path/to/document.Rmd",
shiny_args = list(launch.browser = TRUE))