adt_get_biocard: Import BIOCARD Data

View source: R/adt_biocard.R

adt_get_biocardR Documentation

Import BIOCARD Data

Description

Import BIOCARD data from source files and generate the analysis dataset.

Usage

adt_get_biocard(
  path = ".",
  reference_time = NULL,
  window_setting = NULL,
  pattern = "*.xls",
  src_files = NULL,
  src_tables = NULL,
  ...,
  verbose = TRUE
)

Arguments

path

Directory of the BIOCARD data files. Default value is the working directory,

reference_time

A data frame contains patients' ID and corresponding reference time for each patient. The cognitive time is set to be the default reference time (if NULL). Use can also specify reference time used. For example, "COG" represents the cognitive time, and "DIAG" represent the diagnosis time.

window_setting

A list contains a integer (unit of days) indicating the maximum acceptable gap time for merging each biomarker test to base data and a logical value indicating whether the time window should overlap. The default value is 730 days and FALSE. For most data, the time windows are calculated from the baseline time (left window = the midpoint between current and the previous time point; right window = the midpoint between current and the next time point). If the time windows are longer than the maximum acceptable length, then force to select biomarkers within the maximum window length we set. For the first and last baseline time, since there is no "previous" or "next" time point available, use the maximum acceptable window length instead. For the overlap setting, ff TRUE, all time windows will set from 1/2 "window" days before the baseline time to the 1/2 "window" days after baseline. In this case, the time windows may overlap, which means some biomarkers may be merged into multiple baseline data. If FALSE, the windows will be calculated from the baseline times. The left window is set to be the midpoint between the current and the previous time point. The right window is set to be the midpoint between the current and the next time point. For the first and last baseline time, since there is no "previous" or "next" time point available, use the maximum acceptable window length instead.

pattern

A string indicating the pattern of all the data files. Default is "*.xls" (should work for both .xls and .xlsx). This pattern is used to read all table names from the path. It can also be other file formats, such as ".csv".

src_files

Updated dictionary file for source file features. See dict_src_files for more details.

src_tables

Updated dictionary file for source table features. See dict_src_tables for more details.

...
verbose

A logical value indicating weather printing out process information.

Value

Returned the analysis dataset with: patients' ids, baseline times, corresponding biomarkers, biomarker test times, etc.

Examples

## Not run: 
## with default unoverlaped window
dt_biocard <- get_biocard(path)

## with costomized window
dt_biocard <- get_biocard(path,
                          window_setting = window_Set)

## with dictionary provided by user
dt_biocard <- get_biocard(path,
                          src_tables = "dict_src_tables.xlsx")

## End(Not run)


Thewhey-Brian/ADTools documentation built on July 1, 2022, 2:08 a.m.