Hi @Andrea
This is very doable in Shiny. I'm going to give you a set of functions to take a look at and hopefully be able piece it together. It is not a trivial app, but it is not unrealistic.
Ideas:
- Layout
- I'd set it up using
tags$table()
,tags$tr()
andtags$td()
(All html tags exist... only some are documented here: https://www.rdocumentation.org/packages/htmltools/versions/0.3.6/topics/builder). Each cell of the table could then contain a single "checkbox" with label.
- I'd set it up using
- Shiny hooks:
- single checkbox: https://shiny.rstudio.com/reference/shiny/1.2.0/checkboxInput.html
- Set the id to be something that is a combination of the name and the item, ex:
check_Mary_mitts
. - Within the server function, I would imagine a
observeEvent
method (https://shiny.rstudio.com/reference/shiny/1.2.0/observeEvent.html) that is nested inside two for-loops (one for the people and the other for the items, skipping impossible combinations) to listen for the changes for each individual check box. This method would then prolly update an R object that knows about all of the check boxes.
- Set the id to be something that is a combination of the name and the item, ex:
- uncheck single checkboxes: https://shiny.rstudio.com/reference/shiny/1.2.0/updateCheckboxInput.html
- This will allow you to "uncheck" other elements in the row. Once unchecked, the regular single checkbox event should take care of updating your "knows all" R object.
- single checkbox: https://shiny.rstudio.com/reference/shiny/1.2.0/checkboxInput.html
The color in the background is a little harder to implement. (Involves css and more complex renderUI setup. Easier to update a working app than to try and learn it all at once.)
Please check back in once you've got the checkboxes how you'd like them! So that I can also see what you're seeing, please follow this guide to produce a reprex, thank you! Shiny debugging and reprex guide