pipeline_settings_get_set {ravepipeline} | R Documentation |
Get or change pipeline input parameter settings
Description
Get or change pipeline input parameter settings
Usage
pipeline_settings_set(
...,
pipeline_path = Sys.getenv("RAVE_PIPELINE", "."),
pipeline_settings_path = file.path(pipeline_path, "settings.yaml")
)
pipeline_settings_get(
key,
default = NULL,
constraint = NULL,
pipeline_path = Sys.getenv("RAVE_PIPELINE", "."),
pipeline_settings_path = file.path(pipeline_path, "settings.yaml")
)
Arguments
pipeline_path |
the root directory of the pipeline |
pipeline_settings_path |
the settings file of the pipeline, must be
a 'yaml' file; default is |
key , ... |
the character key(s) to get or set |
default |
the default value is key is missing |
constraint |
the constraint of the resulting value; if not |
Value
pipeline_settings_set
returns a list of all the settings.
pipeline_settings_get
returns the value of given key.
Examples
root_path <- tempfile()
pipeline_root_folder <- file.path(root_path, "modules")
# create pipeline folder
pipeline_path <- pipeline_create_template(
root_path = pipeline_root_folder, pipeline_name = "raveio_demo",
overwrite = TRUE, activate = FALSE, template_type = "rmd-bare")
# Set initial user inputs
yaml::write_yaml(
x = list(
n = 100,
pch = 16,
col = "steelblue"
),
file = file.path(pipeline_path, "settings.yaml")
)
# build the pipeline for the first time
# this is a one-time setup
pipeline_build(pipeline_path)
# get pipeline settings
pipeline_settings_get(
key = "n",
pipeline_path = pipeline_path
)
# get variable with default if missing
pipeline_settings_get(
key = "missing_variable",
default = "missing",
pipeline_path = pipeline_path
)
pipeline_settings_set(
missing_variable = "A",
pipeline_path = pipeline_path
)
pipeline_settings_get(
key = "missing_variable",
default = "missing",
pipeline_path = pipeline_path
)
unlink(root_path, recursive = TRUE)
[Package ravepipeline version 0.0.1 Index]