Write Auto Generated YAML BayLum Configuration File to the Disc
Source:R/write_YAMLConfigFile.R
write_YAMLConfigFile.Rd
This little function helps to auto-generate a the BayLum YAML configuration file or a list that can be passed to create_DataFile. The YAML file itself can be modified in any text editor. The allowed parameters are extracted from the reference YAML file
Arguments
- output_file
character (with default): valid file path of the output file
- ...
parameters to be preset in the YAML file (run
write_YAMLConfigFile()
to see allowed parameters) The parametersample
is special, because it can be provided as a character vector of any length. The number of elements in the vector (sample names) are then used to multiply the records in the configuration file.
Value
The function has two output modes:
(1)
output_file = <file_path>
: Writes a YAML into the specified path and returns this path.(2)
output_file = NULL
: Returns a list of allowed function parameters that can be passed to the function and it returns a list that can be used a passed on to create_DataFile.
How to cite
Kreutzer, S., 2024. write_YAMLConfigFile(): Write Auto Generated YAML BayLum Configuration File to the Disc. Function version 0.1.0. In: Christophe, C., Philippe, A., Kreutzer, S., Guérin, G., Baumgarten, F.H., Frerebeau, N., 2024. BayLum: Chronological Bayesian Models Integrating Optically Stimulated. R package version 0.3.3.9000-13. https://CRAN.r-project.org/package=BayLum
Examples
## generate list
write_YAMLConfigFile(
sample = c("samp1", "samp2"),
settings.rules.endTest = 10)
#> ── Allowed function parameters (start) ─────────────────────────────────────────
#> sample
#> files
#> settings.dose_points
#> settings.dose_source.value
#> settings.dose_source.error
#> settings.dose_env.value
#> settings.dose_env.error
#> settings.rules.beginSignal
#> settings.rules.endSignal
#> settings.rules.beginBackground
#> settings.rules.endBackground
#> settings.rules.beginTest
#> settings.rules.endTest
#> settings.rules.beginTestBackground
#> settings.rules.endTestBackground
#> settings.rules.inflatePercent
#> settings.rules.nbOfLastCycleToRemove
#> ── Allowed function parameters (end) ───────────────────────────────────────────
## generate file (here written in tempdir)
write_YAMLConfigFile(
output_file = tempfile("configuration.yml"),
sample = c("samp1", "samp2"),
settings.rules.endTest = 10)
#> [1] "/tmp/RtmpgCzkor/configuration.yml16b9606621f3.yml"