read_metadata: Read a study metadata file

View source: R/spec.R

read_metadataR Documentation

Read a study metadata file

Description

Reads a yaml metadata file into a named 'list' of study-level values suitable for the 'metadata' argument of [read_spec()] and [apply_tokens()]. Each top-level key in the file becomes a '{token}' that can be referenced in the 'titles' and 'footnotes' fields of a spec. An example file is shipped at 'system.file("metadata.yml", package = "autoslider.core")'.

Usage

read_metadata(metadata_file = "metadata.yml")

Arguments

metadata_file

'character(1)'. Path to a yaml metadata file, i.e. a flat mapping of 'key: value' pairs.

Value

A named 'list' of metadata values.

See Also

[read_spec()], [apply_tokens()]

Examples

metadata_file <- system.file("metadata.yml", package = "autoslider.core")

## Take a look at the 'raw' content of the metadata file
cat(readLines(metadata_file), sep = "\n")

## Read it into a named list of token values
read_metadata(metadata_file)

autoslider.core documentation built on Sept. 29, 2026, 5:08 p.m.