Learn R Programming

connector (version 1.0.0)

remove_metadata: Remove metadata from a YAML configuration file

Description

This function removes metadata from a YAML configuration file by deleting the specified key from the metadata section of the file.

Usage

remove_metadata(config_path, key)

Value

(invisible) config_path where the configuration have been updated

Arguments

config_path

The file path to the YAML configuration file

key

The key for the metadata entry to be removed

Examples

Run this code
config <- tempfile(fileext = ".yml")

file.copy(
  from = system.file("config", "_connector.yml", package = "connector"),
  to = config
)
# Add metadata first
config <- config |>
  add_metadata(
    key = "new_metadata",
    value = "new_value"
  )
config
#' # Now remove it
config <- config |>
  remove_metadata("new_metadata")
config

Run the code above in your browser using DataLab