This function may be used to rapidly develop visualizations by replacing a workflow of reloading and executing code manually.
Usage
hgd_watch(
watch = list.files(pattern = "\\.R$", ignore.case = T),
on_change = function(changed_files) {
print(changed_files)
},
interval = 1,
on_start = hgd_browse,
on_exit = NULL,
on_error = print,
reset_par = TRUE,
...
)
Arguments
- watch
Paths that are watched for changes (see
utils::fileSnapshot()
)- on_change
Will be called when a file changes.
- interval
Time interval in which changes are detected (in seconds).
- on_start
Will be called after the httpgd server is started (may be set to
NULL
).- on_exit
Will be called before the server is closed (may be set to
NULL
).- on_error
Will be called when on_change throws an error (may be set to
NULL
).- reset_par
If set to
TRUE
, global graphics parameters will be saved on device start and reset every timeunigd::ugd_clear()
is called (seegraphics::par()
).- ...
Additional parameters passed to
hgd(webserver=FALSE, ...)