This function removes metadata from a YAML configuration file by deleting the specified key from 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
# Add metadata first
config <- config |>
add_metadata(
key = "new_metadata",
value = "new_value"
)
config
#> [1] "/tmp/Rtmpp1dzyw/file1ebee4a6f4d.yml"
#' # Now remove it
config <- config |>
remove_metadata("new_metadata")
config
#> [1] "/tmp/Rtmpp1dzyw/file1ebee4a6f4d.yml"