Skip to content

How to debug mapApp() without rebuilding package

Dan Kelley edited this page Oct 9, 2021 · 4 revisions

It can take a minute or two to build the package (depending on whether you're rebuilding vignettes, which requires a full index download), and this can be annoying in testing out small changes to mapApp(). But there's a faster way!

Here's how. In R, do something like

library(argoFloats)
shiny::shinyOptions(age=10, destdir="~/data/argo",argoServer=argoDefaultServer(),colLand="lightgray",debug=0)

(changing entries to match your setup). Then set the working directory to inst/shiny/mapApp.

The above steps need to be taken only once per session. Now you are set up for rapid development. To run mapApp(), just type

runApp()

in the R console (or, if you wish, click an icon in an RStudio window that is open to the app.R source).

The development loop is now very fast. Just relaunch the app after every edit to app.R. Since the index data are cached in the session, you'll find that mapApp() displays its initial screen in a few seconds.

Clone this wiki locally