简体   繁体   中英

RShiny - How to share app within network

I created an R Shiny application that I'd like to share with my co-workers within my network. I tried hosting the app on my computer so that other users from the network could access it and use it with their data files.

I tried:

    runApp("appname",host="0.0.0.0",port=3986)

And also:

    runApp("appname",host="DNSMachinename")

The latter attempt resulted in the following error:

While my colleagues are able to acceess the app, it doesn't really run like it does on my machine. Thanks for the help.

The shiny tutorial list a number of ways to share your app . I particularly hosting a zip file somewhere with the app, and letting your co-workers use runUrl to automatically download the app and run it locally. In this way people can continue to run the latest version of the app, but it does not run on your machine.

Since you showed your interest in Shiny server, and it might be more convenient for me to just post a few thoughts in the "answer" since it won't fit well in the comment.

Since you have a group, and I would highly recommend you take a look at R server and shiny server.

(1) Shiny server

You can totally install Shiny server on a old computer and I would recommend using Linux OS like (Ubuntu) and it will save you some time following the tutorial. We have a cluster and we used one of the servers there to host a shiny server and shiny server at the same time. And only internal employee can access it and it is within company's network.

(2) R server

I am not exactly sure which environment you are using to program R but if you want to evangalize R in your team. Have a stable environment that could be accessed by everyone inside your company with authentication is a good way to get started.

(3) shinyapps.io

Is a free platform that you can host your shiny app, it is in alpha version and I don't think there is much authentication or security built in. HERE enter link description here is an example hosted on shinyapps.io

(4) AWS free tier

If you have never used AWS before, you can have a micro instance running on AWS free for one year! I would highly recommend using AWS instead F* around with a old computer.

If you are still trying to get buy-in for your server or cloud solution, I just finished developing the RInno package for this exact problem, ie when a company will not pay for Shiny Server or there are security concerns with cloud services.

To get started:

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

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

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

If you would like to include R for your co-workers who don't have it installed, add include_R = TRUE to create_app :

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

It defaults to include shiny, magrittr and jsonlite, so if you are using other packages like ggplot2 or plotly, just add them to the pkgs argument. You can also include GitHub packages to 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"))

If you are interested in other features, check out FI Labs - RInno

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM