Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launch and terminate shiny app through terminal

Tags:

terminal

r

shiny

How can I launch the Shiny App, "my_shiny" through the terminal.

Also, how do I terminate or close the app through the terminal only.

like image 363
Domains Barter Avatar asked Mar 14 '16 11:03

Domains Barter


People also ask

How do you run a Shiny app in terminal?

To run a Shiny application from the RStudio IDE, click on “Tools” in the menu bar. Then, select “Terminal” followed by “New Terminal”. This will open a terminal tab next to your R console.

Can you run Shiny app locally?

You might be eager to deploy your Shiny app to a remote server. But the simplest way to run a Shiny app is to run it locally. You only need the shiny R package installed, and you can run the app in your browser. In this post you'll see a few ways of how to organize your files to be served locally.

Can you run Shiny app without R?

If you are visiting a web hosted Shiny app through your browser using the web address of the app then you don't need R installed in your computer otherwise you do. What background does one need to learn R?

How do I publish a Shiny app to RStudio connect?

Publish your Shiny App to RStudio ConnectAt the top of the editor, click Publish. In the Publish to Server window, confirm that your account is shown in the Publish To Account section and click Publish. You can monitor the status of the deployment in the RStudio IDE Deploy pane.


2 Answers

Try this:

Rscript -e 'library(methods); shiny::runApp("my_shiny/", launch.browser = TRUE)'
like image 56
Giacomo Avatar answered Sep 17 '22 14:09

Giacomo


Or shorter:

R -e "shiny::runApp('my_shiny')"

If you want to specify a port:

R -e "shiny::runApp('my_shiny', port = 3838)"

As with most other commands, you can interrupt the process with Ctr+ C.

like image 38
bathyscapher Avatar answered Sep 20 '22 14:09

bathyscapher