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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s