Learn R Programming

connector (version 0.1.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

The updated configuration after adding the new metadata

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
# Read the YAML file
test_config <- system.file("config", "default_config.yml", package = "connector")
file.copy(test_config, "test_config.yaml")

# Add metadata
config <- add_metadata("test_config.yaml", "new_metadata", "new_value")

unlink("test_config.yaml")

Run the code above in your browser using DataLab