This function adds metadata to a YAML configuration file by modifying the provided key-value pair in the metadata section of the file.
Examples
config <- tempfile(fileext = ".yml")
file.copy(
from = system.file("config", "_connector.yml", package = "connector"),
to = config
)
#> [1] TRUE
config <- config |>
add_metadata(
key = "new_metadata",
value = "new_value"
)
config
#> [1] "/tmp/Rtmpp1dzyw/file1ebe2a67e31b.yml"