Deploying R shiny app as a standalone application

前端 未结 4 761
陌清茗
陌清茗 2020-11-28 19:43

I have developed a RShiny application which I would like to share internally with my colleagues (Hosting the app on a server, is not an option at this stage).

I was

相关标签:
4条回答
  • 2020-11-28 20:12

    I'm not familiar with that approach, is it common? I personally haven't ever seen it. It looks like essentially what you're doing is bundling R, Shiny, a web browser, and your code, into a file. It's as if the client installs R, Chrome, shiny, and runs your code, but he just does it all in one click. You're literally giving the user your code. I don't know how it works, but if the author himself claimed that the client will be able to see the source code, then that makes sense to me and I don't think you can avoid that.

    Why not just host the file on a shiny server or shinyapps.io? The client won't see your code then. Also, is it really that important that they can't see your code? A lot of times people are afraid of others seeing their code but in reality nobody really cares to look at others people's code and steal it. Unless you have some very proprietary and advanced patented code.

    0 讨论(0)
  • 2020-11-28 20:20

    You might be interested in DesktopDeployR, a framework for deploying self-contained R-based applications to the desktop.

    https://github.com/wleepang/DesktopDeployR

    0 讨论(0)
  • 2020-11-28 20:21

    I'm not sure if it would be a great fit on the code obscurity question, but the RInno package is designed to help with the data security problem, i.e. when a company does not want to share their data with a third party. It also automates the process you referenced above and allows you to connect your app to GitHub/Bitbucket to push out updates to locally installed shiny apps via API calls on startup.

    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. If you'd like a guide on how to connect it to GitHub/Bitbucket check out the Continuous Installation guide :).

    0 讨论(0)
  • 2020-11-28 20:27

    There is now a way to turn a Shiny app into a standalone Electron app (which is a desktop app, used for apps like Slack). To find out more, see this excellent presentation (YouTube) from useR 2018, which contains further links:

    • GitHub ColumbusCollaboratory: electron-quick-start

    • GitHub ColumbusCollaboratory: Photon. RStudio Add-in to build Shiny apps utilizing the Electron framework

    • @TravisHinkelman's blog "Deploying a Shiny app as a desktop application with Electron"

    0 讨论(0)
提交回复
热议问题