0

So, I have some geojson data that I have that I was thinking of turning into a plot using ggplot2. That same data with added detail is also sitting inside of a reactable table. I want to link the map to the table so that when the user clicks on a location, the table will sort to show only the information for that location. How might I do this? Also, is R the way to do this or should I look at using something else?

AkRFL
  • 19
  • 4
  • Dependent on the level of interactivity you desire, you can look into `{crosstalk}` or `{Rshiny}`. Crosstalk allows to hook up html widgets and some base interactivity. The filtering case you are describing is feasible (but you need to convert ggplot into plotly and to have this enabled). RShiny is a bit more sophiticated and you can programme super fancy stuff/user interfaces with it. However, Rshiny require a shiny server, if you share it with users not able to open the code in RStudio. From a learning perspective, Rshiny might require more time to master (but gives you the most freedom). – Ray Aug 09 '21 at 16:54
  • https://www.youtube.com/watch?v=Htg_l8lzgMs might get you started with crosstalk. More on crosstalk can be found at https://rstudio.github.io/crosstalk/. You will find several tutorials on how to do this. The trick is to create a shared data object that both widgets use. – Ray Aug 09 '21 at 16:59
  • Thank you so much! Crosstalk makes a lot of sense here. The end product will end up going on a website, so I think the html widgets are the route to go. – AkRFL Aug 09 '21 at 17:32
  • Awesome. Glad that this helps you getting going! – Ray Aug 10 '21 at 07:29

0 Answers0