add_metadata.Rd
Given a dataframe with observations as rows and variables as columns, and given a dataframe of metadata with variables as rows and information as columns, add metadata to the variables present in the dataframe.
add_metadata(dat, metadat, categorical_types, cols_to_exclude)
A dataframe or tibble of data. A dataframe.
A dataframe or tibble of metadata. Currently, the following fields are required:
description
, a text description of the variable.
remark
, any remark about the variable (e.g., if certain values were imputed).
type
, type of variable (e.g., numerical).
comments
, any other remark about the variable (e.g., unit of measurement).
dag
, name of the variable as present in the DAG.
period
, period of measurement of the variable (e.g., pregnancy).
label
, labels of the levels in case of categorical variables,
separated by a comma and a space.
code
, levels of the variable if categorical, separated by a comma.
A dataframe.
Identifiers, as strings, of categorical types. A vector.
A dataframe containing annotated variables.