metadata_add_substitution is used to align the categorical trait values used by a contributor to the categorical values supported by the database. These values are defined in the traits.yml file.

metadata_add_substitution(
  dataset_id,
  trait_name,
  find,
  replace,
  match = "value"
)

Arguments

dataset_id

Identifier for a particular study in the database

trait_name

The database defined name for a particular trait

find

Trait value in the original data.csv file

replace

Trait value supported by database

match

Optional. "word" replaces find wherever it occurs as a whole word/phrase within a multi-value cell, leaving the rest of the cell untouched. Default "value" requires find to equal the entire cell, and is omitted from the written metadata to keep existing files unchanged.

Value

metadata.yml file with a substitution added