-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.R
61 lines (52 loc) · 1.39 KB
/
run.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{
function(proceed = TRUE, save_all = TRUE) {
if (interactive()) {
if (
requireNamespace("rstudioapi") &&
rstudioapi::isAvailable() &&
save_all
) {
rstudioapi::documentSaveAll()
}
targets::tar_visnetwork() |>
print()
proceed <- usethis::ui_yeah(
"Do you want to proceed with {usethis::ui_code('tar_make')}?"
)
}
if (proceed) {
withr::with_envvar(
list(RSTUDIO_VERSION = "2021.09.0"), {
# devtools::test(stop_on_failure = TRUE)
targets::tar_make()
# targets::tar_make_future(workers = 2)
}
)
targets::tar_visnetwork(
targets_only = TRUE,
degree_from = 5,
degree_to = 5
) |>
print()
}
# if (Sys.getenv("R_telegram_bot_name") != "") {
# depigner::start_bot_for_chat("varicella.due")
#
# targets::tar_visnetwork(
# targets_only = TRUE,
# outdated = FALSE
# ) |>
# visNetwork::visSave(file = here::here("inst/tar_visnetwork.html"))
#
# depigner::send_to_telegram(
# "New run finished. Here below final DAG."
# )
# webshot::webshot(
# here::here("inst/tar_visnetwork.html"),
# here::here("inst/tar_visnetwork.png"),
# delay = 0.1
# )[[1]] |>
# depigner::send_to_telegram(type = "photo")
# }
}
}()