Skip to contents

Adds the metadata (YAML) and quantitative data (CSV) for a single study to the project, performing validation against the project's schema.

Usage

add_study_data(path = ".", study_id, metadata_list, data_df, overwrite = FALSE)

Arguments

path

Character string. The path to the root directory of the metawoRld project. Defaults to the current working directory (.).

study_id

Character string. A unique identifier for the study (e.g., PMID, DOI, or a custom ID). This will be used as the directory name within the data/ folder. Should be filesystem-friendly.

metadata_list

List. A named list containing the study's metadata, conforming to the metadata_fields defined in the project's schema. Must include measurement_methods and outcome_groups as named lists if linkage validation is expected.

data_df

Data frame. A data frame containing the quantitative data, conforming to the data_fields defined in the project's schema. Must include method_ref_id and group_label columns matching keys in metadata_list for linkage validation.

overwrite

Logical. If a directory for study_id already exists, should its contents be overwritten? Defaults to FALSE.

Value

Invisibly returns the path to the created or updated study directory.