3
votes

I created web application using shiny package in R Studio.
I want to open that web app in browser without opening(displaying) R Studio.
Is this possible?
I tried batch file but only RStudio is opening. Code for batch file is below;

START " " "C:\Program Files\RStudio\bin\rstudio"
[library(shiny)]
[runApp("E:\\Other stuffs/R Shiny learning/mywebapp")]

I want to pass
library(shiny)]
runApp("E:\Other stuffs/R Shiny learning/mywebapp")
this command to R console.

Could you please help me.
Thanks in advance

3

3 Answers

4
votes

RStudio is not R. RStudio is a development environment for R. You do not need RStudio to run R, you do not need RStudio to run Shiny apps.

If you only want to run R, then just run R.

You didn't say what OS you are using, but i'll take a wild stab and say Windows. In which case R can be found where you installed it - somewhere like C:\Program Files\R\R-3.0.1\

In there you should find somewhere an exe called something like Rscript.exe. Run that in your .bat file, and R will run in the command window with just its text input and output - no fancy RStudio environment. You can even but the R code in a file and run that instead of trying to inline it in your batch file.

Apologies for vagueness, but I don't run Windows so am uncertain on exact path names. Search for "running R on the command line in Windows" for more.

1
votes

Long term: I think you're looking for Shiny Server. It's a hosting environment for Shiny Applications that, among other things, allows you to host multiple Shiny Applications.

We do not currently support Windows, though. If you're looking for someone else to host the application for you, we currently host a version of Shiny Server for free. See the "Deploying Shiny Apps" section here.

0
votes

Shiny Server is a great solution if you have access to a server or cloud service, and spacedman is correct about the difference between RStudio and R.

However, you can now use the RInno package to install local Shiny apps which is more reliable than a command line start up. To get started:

install.packages("RInno")
require(RInno)
RInno::install_inno()

Then you just need to call two functions to setup an installation framework:

create_app(app_name = "myapp", app_dir = "path/to/myapp")
compile_iss()

That will create a new folder called "RInno_installer" with your app's installer. If you'd like to learn more about this option, check out FI Labs - RInno