0

I've written a function that takes a data frame of specific points and plots them using ggplot, creating a picture. I'd like to be able to take this picture and use it as a GUI for a Shiny app, where users can click anywhere on the picture, add some information from the click, and then append the click's coordinates and information to a data frame (that's originally empty). Ideally this data frame would be able to be downloaded for further analyses.

Is this possible? If so, how do I go about including the functionality in the Shiny app? I'd share code, but the data frame is long and I don't have anything in the Shiny app yet to share. More specific information about the project upon request.

rossdrucker9
  • 439
  • 3
  • 11
  • 1
    Yes it is possible. How about you share a some code that you have tried so we could help you out. – SBista Feb 11 '18 at 08:18
  • That's the thing: I don't really know how to start to go about this. I can share the functions I wrote, but in terms of Shiny I don't have anything in the app yet. – rossdrucker9 Feb 11 '18 at 18:20
  • Have you tried going through [Shiny tutorials](https://shiny.rstudio.com/tutorial/)? – SBista Feb 12 '18 at 02:50
  • I have, but I didn't find what I was looking for. – rossdrucker9 Feb 12 '18 at 04:38
  • How about [this](https://shiny.rstudio.com/articles/plot-interaction.html) to get you started? – SBista Feb 12 '18 at 07:54
  • HUGE help, I can't believe I missed that! I've got that part working. Is there a way to pull files from the directory (and therefore a subdirectory) that contains the Shiny app script? – rossdrucker9 Feb 13 '18 at 00:19
  • Maybe [shinyFiles](https://github.com/thomasp85/shinyFiles) is what you are looking for. – SBista Feb 14 '18 at 07:17
  • I'll definitely check that out. Other issue I'm having: how can I get the ggplot to add a point after a user clicks? I've gotten the rest, but can't seem to get the clicked point to plot. I've tried geom_point() to no avail. – rossdrucker9 Feb 14 '18 at 22:30
  • Code for what I've got so far can be found here: https://github.com/rossdrucker/nothing-but-net/blob/master/app.R – rossdrucker9 Feb 14 '18 at 22:38
  • Could you create a minimal example and post it as a separate question so that it would be helpful for others that would run into similar query? – SBista Feb 15 '18 at 03:24
  • This is what I've created. I'm still stuck on it. Any advice would be greatly appreciated! https://stackoverflow.com/questions/49190820/create-data-set-from-clicks-in-shiny-ggplot – rossdrucker9 Mar 09 '18 at 20:14

0 Answers0