possible to run RShiny app without opening an R environment?

后端 未结 7 1136
一个人的身影
一个人的身影 2021-01-30 05:45

Currently I have a R shiny app, to run it I open up RStudio and execute

setwd(\"C:/Users/Me/Desktop/R/ShinyProject2\")
library(shiny)
......
runApp()
         


        
7条回答
  •  清酒与你
    2021-01-30 06:12

    Below is a quick fix. go to the project directory in command line by cd. then

     R -e "shiny::runApp(port=8000,host = getOption('shiny.host', '10.10.10.10'))"
    

    now the URL 10.10.10.10:8000 will be active.

    To keep the URL alive even after you log off, nohup can be used. Obviously, not the desired setup for a production environment.

     nohup R -e "shiny::runApp(port=8000,host = getOption('shiny.host', '10.10.10.10'))" &
    

提交回复
热议问题