Learn R Programming

connector (version 1.0.0)

add_metadata: Add metadata to a YAML configuration file

Description

This function adds metadata to a YAML configuration file by modifying the provided key-value pair in the metadata section of the file.

Usage

add_metadata(config_path, key, value)

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 new metadata entry

value

The value for the new metadata entry

Examples

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

file.copy(
  from = system.file("config", "_connector.yml", package = "connector"),
  to = config
)

config <- config |>
  add_metadata(
    key = "new_metadata",
    value = "new_value"
  )
config

Run the code above in your browser using DataLab