I'm working on a survey dataset. I have answers (column 2) by people from different countries (column 1).
Column 1 | Column 2 |
---|---|
China | Answer A |
China | Answer B |
France | Answer A |
France | Answer C |
Italy | Answer B |
My Shiny app (https://aurelienmaignant.shinyapps.io/shiny/) displays plots and allow the user to filter by country (with reactive plots). I'm using dlpyr,
I want to create a plot that shows only the values in col2 that are shared at least once by all selected countries (col1).
For example, if the user in shiny selects "China" and "France", the plot output should display only "Answer A" (because answer A is answered at least once by someone from France and at least once by someone from China).
If the user in shiny selects "China", "France" and "Italy", the output should be "None", because none of the three answer (A, B or C) is shared at least once by someone from each countries.
Thanks for your help