12 September 2014

shinyStore – Persistent Client-Side Storage in Shiny

We’re thrilled to announce the availability of shinyStore, an R package that enables HTML5 Web Storage from Shiny, an interactive web application framework for R.

A live demo of an example application is available here. Set a text value then refresh the page, or close the tab and come back in a new tab. You’ll find that any tab in that browser will always remember the last text value you’d saved. You can imagine using this functionality to remember a user’s preferences or inputs for your application.

The package is open-source (MIT) and the code and more details can be obtained from the GitHub page; if you encounter any problems or feature requests, feel free to open a ticket there.

To get started with the package, you’ll need to installed it from GitHub, as it’s not yet available on CRAN. The easiest way to do this is using the devtools package which you should install if you haven’t already:

install.packages("devtools")
library(devtools)

Now you’re ready to install shinyStore and load up one of the examples:

# Load shiny (I'm assuming it's already installed)
library(shiny)

# Run one of the included examples in the shinyStore package.
runApp(system.file("examples/01-persist", package="shinyStore"))

We’re interested in hearing ways that you might be able to use this package, or ways that it could be improved to better accommodate your use cases!