This does just want I want, allowing me to select points on a chart, and returning the rows for those points.
However, I would like to export or save those rows as an object in R, but am having trouble figuring out how to do so. At the moment they are just printed as an output on the html document.
It looks like this should write output to the "x" object, which is what I would like to do. However, when I run it, the x object never appears. The console continues to say "Listening on http://....." but no output is ever generated, except as text in the html. Am I missing something obvious?
Oh, you mean in the Environment tab inside RStudio? If that's the case, then it makes sense that it doesn't show an x variable because the instance of the Shiny app runs in a completely separate R environment as your script. To persist the data, you'll probably need to write the selection to a file and the load the file inside the script, although I'm not 100% sure of a valid case for that
Yes, ideally I’d like it to write an object in the Rstudio environment. However, I’d be happy if it just write the selection to a csv file if that’s easier to do. Basically, I’m after any way to get the selected data, without having to copy/paste it from the html.
Thanks!
This has been working great, but I've run into a problem where the data I'm plotting is too large, and it would be useful to zoom in on a section before making the brush selection.
Specifically, I think the best solution would be two charts, like the middle and right charts in the link above. So I would make a brush selection on the first chart; the second chart would zoom into that selection. I would then make a brush selection on the second chart and this would be output as csv.
I've been playing around trying to join these bits of code together, but I've not managed to get anything close to working yet. When I add output$info t try and get the save the brush selection on the zoomed chart as csv, nothing happens.
Hi, I'd try copying the code in the sample app form the Shiny gallery, make sure that it works on my environment (some packages may need to be updated, thus masking your possible real issue), and if that works, I would start switching that copy to my data source, running it every so often to make sure that it still works.