Apologies if this has been covered or is trivial, but I can't figure it out:
If you start a Shiny app from within a longer R script, is there a way to exit from the Shiny app and continue with the execution of the calling script?
What I am trying to do is 1) load and reformat a large dataset with an R script, 2) do some processing interactively with Shiny (low-pass filtering, baseline adjustment, peak finding), and 3) run the final computations non-interactively. The official way of ending Shiny (
http://rstudio.github.io/shiny/tutorial/#run-and-debug) requires interrupting R by typing Esc or clicking Stop, which also terminates the execution of the calling script.
One way around the problem would be writing the reformatted dataset to a temporary file and pause the calling R script; start Shiny as a separate process, load the temp file, do the interactive processing, and write another temp file; and resume the calling script, read in the second temp file, and finish. That's a bit klutzy, and all the file I/O takes a while.
Another way would be doing everything within the Shiny framework. But I don't want the structure of the entire program to depend on a single R package and I want to be able to interact directly with my data from the R console.
Thanks for any help,
Richard