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.
Try this:
Rscript -e 'library(methods); shiny::runApp("my_shiny/", launch.browser = TRUE)'
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
.
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
. :)
taskkill