13

I would like to have an option (when working locally) which allows me to see changes in my shiny app automatically after I put some changes in server.R or ui.R file. It is really annoying to manually rerun runApp function every time I add a new thing.

The optimal solution which I really like is xaringan::inifinite_moon_reader function which is extremely helpful.

Is there any solution which do this stuff?

You can find analogical solution here. On the right, the code was modified and saved, on the left, the content of page was updated.

Nicolabo
  • 1,337
  • 12
  • 30
  • Refreshing the page doesn't help? It works for me – Omri374 Jan 03 '18 at 11:50
  • Don't know how. What I really want to achieve to: runApp -> change code in server.R/ui.R file -> save changes. Then an app in the browser should automatically modify. – Nicolabo Jan 03 '18 at 11:55
  • If you run the shiny app in your browser, once you save your changes in server.R/ui.R (or any other file that is sourced by them), you can just hit F5 on your browser to get the updated app – Omri374 Jan 03 '18 at 12:08
  • Ok it works in two-files app. But I would like to avoid "hit F5" step. – Nicolabo Jan 03 '18 at 12:25
  • 5
    hello from https://shiny.rstudio.com/reference/shiny/1.0.3/shiny-options.html you can do `options(shiny.autoreload.pattern = glob2rx("ui.R"))` if you want to autoreload tu `UI` – s.brunel Jan 03 '18 at 12:33
  • Thanks! You make my day! – Nicolabo Jan 03 '18 at 13:23

1 Answers1

14

Executing

options(shiny.autoreload = TRUE)
should do the trick.
JaKu
  • 1,096
  • 16
  • 29