shiny.collections adds persistent reactive collections that can be effortlessly integrated with components like Shiny inputs, DT::dataTable or rhandsontable. The package makes it easy to build collaborative Shiny applications with persistent data.
Note! This library is still in its infancy. Api might change in the future.
At the moment it’s possible to install this library through devtools.
devtools::install_github("Appsilon/shiny.collections")
To install previous version you can run:
devtools::install_github("Appsilon/shiny.collections", ref = "0.1.0")
Before running an example make sure that your RethinkDB is set-up and running. For installation and running guidelines you can visit RethinkDB docs.
library(shiny)
ui <- shinyUI(fluidPage(
actionButton("click", "Add one"),
DT::dataTableOutput("cars_data")
))
connection <- shiny.collections::connect()
server <- shinyServer(function(input, output) {
cars <- shiny.collections::collection("cars", connection)
observeEvent(input$click, {
shiny.collections::insert(cars, list(name = "Sample name", value = sample(1:100, 1)))
})
output$cars_data <- DT::renderDataTable(DT::datatable(cars$collection))
})
shinyApp(ui = ui, server = server)
We are proud that shiny.collections gained a lot of interests at useR!2017 in Brussels. Here you can see a talk by Marek Rogala presenting two interesting use cases: https://goo.gl/mD1KfV .
If you want to contribute to this project please submit a regular PR, once you’re done with new feature or bug fix.
Changes in documentation
Both repository README.md file and an official documentation page are generated with Rmarkdown, so if there is a need to update them, please modify accordingly a README.Rmd file and run a build_readme.R script to compile it.