tar_watch | R Documentation |
Launches a background process with a Shiny app
that calls tar_visnetwork()
every few seconds.
To embed this app in other apps, use the Shiny module
in tar_watch_ui()
and tar_watch_server()
.
tar_watch(
seconds = 10,
seconds_min = 1,
seconds_max = 60,
seconds_step = 1,
targets_only = FALSE,
exclude = ".Random.seed",
outdated = FALSE,
label = NULL,
level_separation = 150,
degree_from = 1L,
degree_to = 1L,
config = Sys.getenv("TAR_CONFIG", "_targets.yaml"),
project = Sys.getenv("TAR_PROJECT", "main"),
height = "650px",
display = "summary",
displays = c("summary", "branches", "progress", "graph", "about"),
background = TRUE,
browse = TRUE,
host = getOption("shiny.host", "127.0.0.1"),
port = getOption("shiny.port", targets::tar_random_port()),
verbose = TRUE,
supervise = TRUE,
poll_connection = TRUE,
stdout = "|",
stderr = "|",
title = "",
theme = bslib::bs_theme(),
spinner = TRUE
)
seconds |
Numeric of length 1, default number of seconds between refreshes of the graph. Can be changed in the app controls. |
seconds_min |
Numeric of length 1, lower bound of |
seconds_max |
Numeric of length 1, upper bound of |
seconds_step |
Numeric of length 1, step size of |
targets_only |
Logical, whether to restrict the output to just targets
( |
exclude |
Character vector of nodes to omit from the graph. |
outdated |
Logical, whether to show colors to distinguish outdated
targets from up-to-date targets. (Global functions and objects
still show these colors.) Looking for outdated targets
takes a lot of time for large pipelines with lots of branches,
and setting |
label |
Label argument to |
level_separation |
Numeric of length 1,
|
degree_from |
Integer of length 1. When you click on a node,
the graph highlights a neighborhood of that node. |
degree_to |
Integer of length 1. When you click on a node,
the graph highlights a neighborhood of that node. |
config |
Character of length 1, file path of the YAML
configuration file with |
project |
Character of length 1, name of the current
|
height |
Character of length 1,
height of the |
display |
Character of length 1, which display to show first. |
displays |
Character vector of choices for the display.
Elements can be any of
|
background |
Logical, whether to run the app in a background process so you can still use the R console while the app is running. |
browse |
Whether to open the app in a browser when the app is ready.
Only relevant if |
host |
Character of length 1, IPv4 address to listen on.
Only relevant if |
port |
Positive integer of length 1, TCP port to listen on.
Only relevant if |
verbose |
whether to print a spinner and informative messages.
Only relevant if |
supervise |
Whether to register the process with a supervisor. If |
poll_connection |
Whether to have a control connection to the process. This is used to transmit messages from the subprocess to the main process. |
stdout |
The name of the file the standard output of
the child R process will be written to.
If the child process runs with the |
stderr |
The name of the file the standard error of
the child R process will be written to.
In particular |
title |
Character of length 1, title of the UI. |
theme |
A call to |
spinner |
|
The controls of the app are in the left panel.
The seconds
control is the number of seconds between
refreshes of the graph, and the other settings match
the arguments of tar_visnetwork()
.
A handle to callr::r_bg()
background process running the app.
Other progress:
tar_canceled()
,
tar_completed()
,
tar_dispatched()
,
tar_errored()
,
tar_poll()
,
tar_progress()
,
tar_progress_branches()
,
tar_progress_summary()
,
tar_skipped()
,
tar_watch_server()
,
tar_watch_ui()
if (identical(Sys.getenv("TAR_INTERACTIVE_EXAMPLES"), "true")) {
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_script({
library(targets)
library(tarchetypes)
sleep_run <- function(...) {
Sys.sleep(10)
}
list(
tar_target(settings, sleep_run()),
tar_target(data1, sleep_run(settings)),
tar_target(data2, sleep_run(settings))
)
}, ask = FALSE)
# Launch the app in a background process.
tar_watch(seconds = 10, outdated = FALSE, targets_only = TRUE)
# Run the pipeline.
tar_make()
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.