get_yaml_value: Extract values from yaml file

View source: R/get_yaml_value.R

get_yaml_valueR Documentation

Extract values from yaml file

Description

Inputs values into yaml file by locating the label and key within the yaml file. Preserves comments (#) if present. NOTE: this does not use a yaml parser so if there are yaml formatting errors this function will not pick them up.

Usage

get_yaml_value(file = "gotm.yaml", label, key)

Arguments

file

filepath; to .yaml which you wish to edit

label

string; which corresponds to section where the key is located

key

string; name of key in which to input the value

Author(s)

Tadhg Moore

Examples

yaml_file <- system.file('extdata/gotm.yaml', package = 'GOTMr')
get_yaml_value(file = yaml_file, label = 'airp', key = 'file')

aemon-j/gotmtools documentation built on April 12, 2024, 4:35 p.m.