Use rmarkdown::run() in a bash script and open the shiny app in browser

Hi

I want to run, from a bash script, an interactive (shiny) report. I am using the following bash command:

Rscript -e "library(LEEF.analysis); db <- '$DB'; report_interactive();"

The function report_interactive rund=s the following command:

  rmarkdown::run(
    file = system.file("InteractiveReport.Rmd", package = "LEEF.analysis")
  )

Now I get a line in bash which says Listening on http://127.0.0.1:3544 with changing ports.

When I now open http://127.0.0.1:3544/InteractiveReport.Rmd the report opens in Safari.

Now I would like to automate the workflow and directly open the shiny app in Safari. Is this possible?

Hi,

According to this post, you can do that by supplying Shiny arguments

rmarkdown::run("InteractiveReport.Rmd", shiny_args = list(launch.browser = TRUE))

Hope this helps,
PJ

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.