How to launch a R-Shiny App after programming

How to launch a shiny App after finishing programming. What there are for posibilities?

I have already written a little batch file wich is working and launching the server an the shiny app.:

start "" "C:\Apps\R\bin\Rscript.exe" Skript.R /k
timeout 17
start "Skript.R" "http://127.0.0.1:7980/"

But when i'm trying to open this batch file from an other c# Tool the Skript.R is not be load and the server is not starting.
Someone maybe no a solution therefore?

Hi,

I'm not sure that I understand what you want to achieve, but to start a Shiny app from the command line you can use

cd /d C:\path\where\my\app\is
"C:\Apps\R\bin\Rscript.exe" app.R

assuming that your app is the file app.R.

In the app.R file, use
shinyApp(ui = ui, server = server, options = list(launch.browser = TRUE))

If you want the application (and the Rscript) to stop after the user exited the Shiny application (closed the browser tab in which the application was running), add the following line to the "server" function

session$onSessionEnded(stopApp)

Hope this helps.

This topic was automatically closed 54 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.