Description Usage Arguments Value Examples
View source: R/configure_task.R
Initialize a configuration file for a future task
1 2 3 4 5 6 7 8 9 10 | configure_task(
dir_path,
fun_path,
fun_name,
conf_descr = NULL,
fun_args = NULL,
priority = 0L,
compress = TRUE,
call. = TRUE
)
|
dir_path |
|
fun_path |
|
fun_name |
|
conf_descr |
|
fun_args |
|
priority |
|
compress |
|
call. |
|
a list containing the conf fields. Attribute 'path' of the result contains the path to the conf directory. The arg field contains either the location of the argument (in "dir_path/inputs/arg_name.RDS") or the argument itself if it is of length 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # create temporary directory
dir <- paste0(tempdir(), "/conf", round(runif(n = 1, max = 10000)))
dir.create(dir, recursive = TRUE)
# create and save conf
conf <- configure_task(dir_path = dir,
conf_descr = list(title = "my_title",
description = "my_descr"),
fun_path = dir, # as an example
fun_name = "my_fun_name",
fun_args = list(x = 1,
y = 0:4,
z = iris),
priority = 1)
# catch results
list.files(conf$dir)
read_conf <- yaml::read_yaml(paste0(conf$dir, "conf.yml"))
y <- readRDS(paste0(conf$dir, "inputs/y.RDS"))
z <- readRDS(paste0(conf$dir, "inputs/z.RDS"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.