Can I run the RShiny application without opening the R environment?

I currently have a brilliant R application to run it, I open RStudio and execute

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

From an R script located in my directory.

I am posting an application to introduce colleagues who do not know how to use R.

So I'm just wondering ... Is there an easy way to write an executable file that directly opens the interface, without having to click open R studio and execute the codes?

+11
source share
5 answers

RStudio! = R

There is a simple command line interface for R that you can run on Windows by running R.exe in the bin folder of your R installation.

There is also Rscript.exe, which can run an expression or script file. For example:

 C:\Program Files\R\R-2.15.2\bin\RScript -e hist(runif(1000)) 

will (given the correct paths) create a PDF file with a histogram in it.

So,

  • your employee needs to install R
  • you need this setup so that all packages run brilliantly
  • or you add install.packages () to your code in your code.
  • you need to provide them with a folder with your brilliant code
  • you add a Windows.BAT file to them to click
  • they run this, it calls Rscript.exe, which launches the brilliant package that you gave them.

Or ask him to be hosted on a brilliant public RStudio reseller server, but then we can all see him.

+16
source

I know this is an old discussion, but it can help someone find out that it can be done now. You can create a stand-alone brilliant application that runs on computers without the need to install R or any library. There is a relatively simple way to do this (currently I have done it only for Windows users, but something for MacOS should also be) by following these detailed steps: http://www.r-bloggers.com/deploying-desktop- apps-with-r / . Another option would be to download the application on the Shiny server.

+9
source

Now you can use the RInno package for this type of thing. To configure:

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

Then you just need to call two functions to set the installation framework:

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

If you want to include R, add include_R = TRUE in create_app :

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

By default, it includes shiny, magrittr and jsonlite, so if you use other packages like ggplot2 or plotly, just add them to the pkgs argument. You can also include GitHub packages in the remotes argument:

 create_app( app_name = "myapp", app_dir = "path/to/myapp" pkgs = c("shiny", "jsonlite", "magrittr", "plotly", "ggplot2"), remotes = c("talgalili/installr", "daattali/shinyjs")) 

For other features, check out FI Labs - RInno

+4
source

I ran into the same problem and used the following two solutions that worked perfectly.

Publish the app on shinyapps.io

Good: the app is available anytime from anywhere. Disadvantage: only 25 active hours per month.

  • Go to https://www.shinyapps.io/ and create a free account
  • Configure rsconnect to communicate R with your new shinyapps account (step-by-step explanations in shinyapps documentation )
  • In Rstudio, click publish (next to the Run Application button).
  • Get the application address from shinyapps.io toolbar and send it to your employees.

Share the application on the local network

Good: as many active hours as you need. Disadvantage: it is required to be on the same local network, and the application must constantly work on a computer connected to this network.

You need to run the application on your computer and share it on the local network by changing the runapp command to:

 runApp(host="0.0.0.0",port=5050) 

And then go to your employees at http: // [your-IP-address]: 5050 (see the following: LAN hosting Brilliant applications are launched from the command line )

+4
source

I know this is a really old discussion, but I recently ran into this problem, and after a few options, I found that it is best to use the shinyshortcut package:

 library(shinyShortcut) shinyShortcut(shinyDirectory = getwd(), OS = .Platform$OS.type, gitIgnore = FALSE) 
0
source

All Articles