8

Is it possible to run Shiny apps from within Visual Studio if I'm using R Tools for Visual Studio (RTVS). If yes, how?

lebelinoz
  • 4,890
  • 10
  • 33
  • 56
  • You can run shiny apps from anywhere R runs. That doesn't necessarily mean it will be hard-coded into the application. Rather, it will open up in your default browser. See the vignette on how to run a shiny app. – Roman Luštrik Aug 10 '17 at 07:01
  • Ah, I see. I was hoping someone would know a nice point-and-click way to do it instead of running the `runApp` line of code every time. – lebelinoz Aug 10 '17 at 07:09
  • Perhaps the team is accepting feature requests (assuming it doesn't exist yet). – Roman Luštrik Aug 10 '17 at 10:52

1 Answers1

10

I thought there wasn't, but as it turns out, there is a "Run Shiny App" button in RTVS!

enter image description here

Hong Ooi
  • 56,353
  • 13
  • 134
  • 187
  • 1
    get: Error in shinyAppDir(x) : App dir must contain either app.R or server.R. Any idea? – cs0815 Nov 02 '18 at 15:12
  • That's because VS does not know there the App is. Give it the address of the folder that contains both ui.R and server.R files, such as "appDir = C:/Users/myShiny", then run "runApp(appDir)", the ShinyApp will run properly. – Z Cao Mar 03 '21 at 03:02
  • hi, i installed RTVS but can't find the button, any idea why? – grymlin Jan 11 '23 at 02:22