shiny.collections, Google Docs-like live collaboration in Shiny

By:
Appsilon Team
August 9, 2017

A few weeks ago, our CTO Marek Rogala gave an engaging talk at the User Conference in Brussels. Despite being one of the last talks, he drew a crowd that filled the room and had significant viewership online. Marek’s talk was entitled <a href="https://channel9.msdn.com/Events/useR-international-R-User-conferences/useR-International-R-User-2017-Conference/shinycollections-Google-Docs-like-live-collaboration-in-Shiny#comments" target="_blank" rel="noopener noreferrer">shiny.collections: Google Docs-like live collaboration in Shiny.</a> In short, he went over a package we built that allows for persistence and collaboration without losing reactivity in Shiny. Users can enter information and have continuity, knowing that if they exit and return to the app, their inputs will still be there. <iframe src="https://www.youtube.com/embed/tDphorVpkk4" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe> Let’s go over his talk. Recently, Shiny users have demanded more from their applications. The advent of cloud applications, especially ones like Google Docs, have accustomed users to collaboration. They expect their Shiny apps to be more than just an interactive tool for data visualisation, but rather, a production ready application that works like any other tool. Their data has to be saved automatically. Interactive collaboration is a must in some use cases. And the application must be delivered as fast as possible. You need to use a reactive database such as rethinkDB, Firebase, or mongoDB to achieve this. mongoDB isn’t really a reactive database, but there are ways where it can be used as one. We are going to use rethinkDB in our case. Also, we are going to use <a href="https://cran.r-project.org/web/packages/rethinker/index.html" target="_blank" rel="noopener noreferrer"><em>rethinker</em></a>, which is a rethinkDB driver for R. But using <em>rethinker</em> is not the most ideal solution, as callback do not work very well with Shiny and it is quite painful to configure to our needs. <blockquote>To get around this, we created our own package built upon <em>rethinker</em> called <a href="https://appsilon.github.io/shiny.collections/"><em>shiny.collections</em></a>. It lets you easily connect to your shiny app and takes care of all of the trickiness involved.</blockquote> During his talk, Marek showed a live demo that involved creating a chat application. <a href="https://appsilon.com/blog/rstats/2017/07/02/shiny-chat.html" target="_blank" rel="noopener noreferrer">Check out how to do this yourself.</a> <strong>I recommend watching Marek first, as he has some valuable commentary you won’t find in the blog post.</strong> This example is just a simple use case of what you can achieve with shiny.collections. We’ve made it a priority to make it convenient and easily integrable with other powerful tools, including DT, leaflet or rhandsontable. Our goals for the future of this package include getting it on cran and diversifying the functionality of the API. Take a look at the our package and contribute. Get in touch with us for all of you other data science needs as well.

Have questions or insights?

Engage with experts, share ideas and take your data journey to the next level!
Explore Possibilities

Share Your Data Goals with Us

From advanced analytics to platform development and pharma consulting, we craft solutions tailored to your needs.

Talk to our Experts
r
infrastructure
shiny dashboards