RShiny - How to share app within network

妖精的绣舞 提交于 2020-02-27 06:41:06

问题


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.


回答1:


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. HEREenter 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.




回答2:


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, i.e. 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




回答3:


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.



来源:https://stackoverflow.com/questions/25897010/rshiny-how-to-share-app-within-network

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!