【问题标题】:Run Shiny App from command line with custom port使用自定义端口从命令行运行 Shiny App
【发布时间】:2022-01-20 10:41:12
【问题描述】:

我正在尝试使用带有自定义端口的 .bat 文件运行 Shiny 应用程序。这是我所拥有的:

test.bat:

d:
cd "C:\Users\directory"
R -e "options(shiny.port = 5242)"
start "prog1" R -e "shiny::runApp()"
start "prog2" "C:\Program Files\Google\Chrome\Application\chrome.exe" "http://localhost:5242"

事实上,执行:

> options(shiny.port = 5242)
> shiny::runApp()

在 RStudio 控制台中工作。但是当我从 cmd 尝试这个时,它不会在不将端口应用到应用程序的情况下打开应用程序。

有什么想法吗?

【问题讨论】:

    标签: r batch-file cmd shinyapps


    【解决方案1】:

    解决办法:

    d:
    cd "C:\Users\directory"
    start "prog1" R -e "options(shiny.port=5242);shiny::runApp()"
    start "prog2" "C:\Program Files\Google\Chrome\Application\chrome.exe" "http://localhost:5242"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-08-20
      • 1970-01-01
      • 1970-01-01
      • 2016-12-25
      • 2015-01-25
      • 2011-11-24
      • 2018-11-02
      相关资源
      最近更新 更多