Learn R Programming

EDCimport (version 0.7.0)

compare_databases: Compare multiple EDC database extractions

Description

Compares several EDC database extractions and returns:

Usage

compare_databases(databases, fun_read = read_trialmaster, ...)

Value

a list of table (a gt object with tooltips) and plot (a patchwork of ggplots)

Arguments

databases

file paths to read using fun_read. Can also be a list of edc_database objects.

fun_read

Reading function to use on databases

...

arguments passed to fun_read

Details

  • a summary table of the detected differences in datasets/columns presence

  • a summary plot of the differences in number of rows, columns, patients, and rows per patient

Examples

Run this code
#list of 3 edc_databases, each being a list of multiple datasets
databases = edc_example_multiple() 

comparison = compare_databases(databases)
comparison$table
comparison$plot

#in real world, you should better use paths with a reader function:
if (FALSE) {
  databases = c(
    "data/MYPROJECT_ExportTemplate_xxx_SAS_XPORT_2024_06_01_12_00.zip",
    "data/MYPROJECT_ExportTemplate_xxx_SAS_XPORT_2024_08_01_12_00.zip",
    "data/MYPROJECT_ExportTemplate_xxx_SAS_XPORT_2024_09_01_12_00.zip",
  )
  #`pw` is passed to `read_trialmaster()`
  comparison = compare_databases(databases, fun_read=read_trialmaster, pw="the_password")
}

Run the code above in your browser using DataLab