Create a Shiny App in R and share it within an organization (cool work around).

The nature of my day to day work does not involve working around technologies or firewall. FYI i do use R for performing statistical analysis and visualization however the current problem at hand was more than just statistical testing. Following is the best way i can describe the issue:

  1. Create a database – for now its a network drive.
  2. Create an interface (using Shiny) to connect to the database/network drive.
  3. Share this shiny app with others within the organization.

Shiny application is very simple. I create a csv file in R that has all the file names (from  network drive) and some columns from the files stored on the network drive. Then using shiny application and DT package i display this information on the interface. The user of this interface will launch the interface and then search for the data, select the file name from the table and click download to download the file. Doing this was very simple.

The problem i faced was after the interface was ready. Due to the sensitive nature of the data i cannot host it on the shiny server and not everyone in my organization will have R installed. If everyone had R life would be simple… send the server.r and ui.r files and ask them to run it in R to open the interface.

The second issue was that out internal technology team are not very good team players. So finding the right person to ask for a server space then convincing them to install R and Shiny package was a bigger hurdle. Given the deadline i needed a solution where i can share this interface within the organization even with people who have no prior knowledge of R.

The best solution so far i could find (after googling for an hour) is the RInno package. here are the links:

  1. github : RInno
  2. CRAN Repository : RInno Package manual

So what does this package do. It basically creates a .exe file. So once you have an interface ready in R, save all your files in a folder and execute RInno package commands. The RInno will generate .exe file which you can share.

You can also pass an argument so that it installs R library for individuals who do not have R installed. When you share the .exe file with someone within your organization, they have to run it like they run any .exe file for installing a software.

Once you run the .exe file it will create a shortcut on the desktop and will also have an uninstall option. So if you update you application you can uninstall the interface by clicking on uninstall. Save the changes to your application and generate a new .exe. Share this new file.

RInno package allows you to provide images for your shortcut icon, you can also write agreements and ask users to accept the agreements etc.

So this solves a lot of issues people working in corporate environment face. Given we all work with sensitive data and hosting outside the company server is a pain, we can now create shiny applications for use without hosting it on a server. We can easily share updates to our application. We can also develop applications for end users who have no knowledge of R for e.g. develop a financial models using shiny and share it with your peers.

 

2 thoughts on “Create a Shiny App in R and share it within an organization (cool work around).

Add yours

  1. Thanks for providing the information. I am like in same situation, where I have created prototype shiny app in my organization and IT is very supportive to host on server for multiple users. This seems to be problem solver for me. There are some queries, Please help me to answer them.

    1. while running the command “RInno::install_inno()” , window prompt to run executable file and asking for admin rights. That is basicall controls by IT.
    Is there any way to download any R package to avoid new exe installation. any other workaround ?

    2. Is shiny app.exe download and install the R, when end user will execute the file. Since that is also restricted by IT.

    3. Is there any limitation of concurrent users of this app.exe file.

    Thanks in advance,

    Waiting for your reply,
    Nilay Adhwaryu
    adhwaryu.nilay@gmail.com

    1. Hi Nilay,
      To be honest, i had created this app for a client demo almost a year back and never ended up working on it after. So will try to answer your questions to the best of my knowledge.

      1. while running the command “RInno::install_inno()” , window prompt to run executable file and asking for admin rights. That is basicall controls by IT.Is there any way to download any R package to avoid new exe installation. any other workaround ?

      AG: The IT controls in my organization were not as strict so i was able to download the packages and run .exe file. one solution is to use shiny server and upload your app on it. The Rinno solution is basically to allow users with no R experience use the app as it will download those libraries when you run exe file. If your organization has a server you can load R and shiny on it and then allow users access via the link to your application. This is not as simple if you are new to servers but shiny server site has a lot of information on this solution.

      2. Is shiny app.exe download and install the R, when end user will execute the file. Since that is also restricted by IT.
      AG: yes it will download R, thats the main idea when i wrote the post. Many users dont want to download 3 different libraries and R to run an app. so basically the Rinno does all the groundwork for you and create a shortcut on your desktop.

      3. Is there any limitation of concurrent users of this app.exe file?
      AG : i dont think so. As i mentioned above it was a one time use for me. But i thought it was really cool so i shared it as a post.

      Hope this helps.
      Regards,
      Atmajit

Leave a Reply

WordPress.com.

Up ↑

%d bloggers like this: