Run Shiny App from Shortcut Windows 10

后端 未结 2 1588
野趣味
野趣味 2021-02-09 15:26

I\'m trying to create a shortcut on the desktop to run a Shiny app. I am stuck on creating a batch file to execute this and after scouring the web, I still haven\'t been able to

2条回答
  •  花落未央
    2021-02-09 16:03

    You have to set the R working directory to the folder containing your shiny files; or explicitly specify the path in your call to runApp().

    Something like this:

    test.bat

    "path/to/Rscript.exe" "path/to/run.R"
    

    run.R

    library(shiny)
    setwd("c:/users/username/Desktop/test")
    runApp()
    

提交回复
热议问题