13

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.

3

2 Answers 2

19

Try this:

Rscript -e 'library(methods); shiny::runApp("my_shiny/", launch.browser = TRUE)'
0
5

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.


Addendum

I wrote this line

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

into a shell script called, e.g., run.sh to conveniently run it from the shell as sh ./run.sh. :)

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.