Watches a .R file for changes and automatically re-runs it when saved.
The file is sourced directly in the current R session. When the app
exits (user quits or it crashes), the file's modification time is
checked and the app re-sources if the file changed.
Details
Workflow: edit your .R file in an editor, save, then quit the
running app (e.g. press q) - it restarts automatically with your
changes. If the app crashes, it waits for the next file save before
restarting.
Press Ctrl+C when the app is not running (i.e. between restarts)
to stop the watcher.
dev_app() is designed for rapid development iteration. It:
Sources and runs the given
.RfileWhen the app exits, checks if the file was modified
If modified: re-sources immediately
If not modified: polls until the file changes, then re-sources
Continues until you press
Ctrl+Cbetween app runs
Because the file is sourced directly (not via a subprocess), the app gets full terminal control and all keyboard/mouse input works normally.
