# NOT RUN {
# }
# NOT RUN {
# create temporary directory for conf
dir_conf <- paste0(tempdir(), "/conf", round(runif(n = 1, max = 10000)))
dir.create(dir_conf, recursive = TRUE)
# ex fun
fun_path = system.file("ex_fun/sb_fun_ex.R", package = "shinybatch")
fun_name = "sb_fun_ex"
# create and save conf
conf <- configure_task(dir_path = dir_conf,
conf_descr = list(
title = "my_title",
description = "my_descr"
),
fun_path = fun_path,
fun_name = fun_name,
fun_args = list(
x = 1,
y = 0:4,
z = iris
),
priority = 1)
conf_init <- yaml::read_yaml(paste0(conf$dir, "conf.yml"))
y <- readRDS(paste0(conf$dir, "inputs/y.RDS"))
z <- readRDS(paste0(conf$dir, "inputs/z.RDS"))
run_task(paste0(conf$dir, "conf.yml"))
# catch results
list.files(conf$dir)
conf_update <- yaml::read_yaml(paste0(conf$dir, "conf.yml"))
output <- readRDS(paste0(conf$dir, "output/res.RDS"))
log <- read.delim(list.files(paste0(conf$dir, "output/"),
pattern = "log_run", full.names = TRUE), header = FALSE)
# }
Run the code above in your browser using DataLab