Skip to contents

This function is to be used after running the metadata_map function.

It compares csv outputs from two sessions, finds their differences, and asks for a consensus.

Usage

map_compare(
  session_dir,
  session1_base,
  session2_base,
  metadata_file,
  domain_file,
  output_dir = session_dir
)

Arguments

session_dir

This directory should contain 2 csv files for each session (LOG_ and OUTPUT_), 4 csv files in total.

session1_base

Base file name for session 1 e.g. 'NationalCommunityChildHealthDatabase(NCCHD)_BLOOD_TEST_2024-07-05-16-07-38'

session2_base

Base file name for session 2 e.g. 'NationalCommunityChildHealthDatabase(NCCHD)_BLOOD_TEST_2024-07-08-12-03-30'

metadata_file

The full path to the metadata file used when running metadata_map (should be the same for session 1 and session 2)

domain_file

The full path to the domain file used when running metadata_map (should be the same for session 1 and session 2)

output_dir

The path to the directory where the concensus output file will be saved. By default, the session_dir is used.

Value

It returns a csv output, which represents the consensus decisions between session 1 and session 2

Examples

if (FALSE) { # \dontrun{
# Locate file paths for the example files in the package
demo_session_dir <- system.file("outputs", package = "mapmetadata")
demo_session1_base <- "360_NationalCommunityChildHealthDatabase(NCCHD)_CHILD_2024-12-19-14-11-55"
demo_session2_base <- "360_NationalCommunityChildHealthDatabase(NCCHD)_CHILD_2024-12-19-14-17-45"
demo_metadata_file <- system.file("inputs", "360_NationalCommunityChildHealthDatabase(NCCHD)_Structural_Metadata.csv", package = "mapmetadata")
demo_domain_file <- system.file("inputs", "domain_list_demo.csv", package = "mapmetadata")

# Run the function - requires user interaction
map_compare(
  session_dir = demo_session_dir,
  session1_base = demo_session1_base,
  session2_base = demo_session2_base,
  metadata_file = demo_metadata_file,
  domain_file = demo_domain_file
)
} # }