Because it's directly linking to Google Sheets, it's going to be a custom implementation.
Communication points to cover:
- User Edit
- Shiny Table to R
- R to Google Sheets
- Sheets Edit
- Google Sheets to R
- R to Shiny Table
Shiny Table to R
DT can have editable tables. See https://rstudio.github.io/DT/ Section 2.3
Demo of getting information to R from the Browser: https://yihui.shinyapps.io/DT-edit/
R to Google Sheets
See the googlesheets R package https://cran.r-project.org/web/packages/googlesheets/vignettes/basic-usage.html
Google Sheets to R
You could maintain a last_updated value. Have a method poll every k seconds to check if the table has been updated.
Ex:
k <- 5
last_updated <- reactiveVal(as.Date("1970-01-01"))
observe({
last_sheet_updated <- ... # look up google sheet last updated time
if ( isolate(last_updated()) - last_sheet_updated < 0) {
# set the last updated time
isolate(last_updated(last_sheet_updated))
# update the browser
update_user_table_method() # must be created
}
# Test again in k seconds
invalidateLater(k * 1000)
})
R to Shiny Table
Look for DT::dataTableProxy. See section 2.3: https://rstudio.github.io/DT/shiny.html .
Demo: https://yihui.shinyapps.io/DT-proxy/
** Code untested