mergelongtreatment: Merge panel data treatment and outcome data

View source: R/mergelongtreatment.R

mergelongtreatmentR Documentation

Merge panel data treatment and outcome data

Description

Merge long format treatment and outcome data from multiple sources with possibly hierarchical matching IDs using data.table

Usage

mergelongtreatment(
  x,
  group_varnames,
  time_varname = "Date",
  start_date,
  end_date,
  interval_days = 14,
  verbose = TRUE,
  trace = 1
)

Arguments

x

Named list: Long form datasets to merge. Will be converted to data.table

group_varnames

Vector, character: Variable names to merge by, in order. If first is present on a given pair of datasets, merge on that, otherwise try the next in line.

time_varname

Character: Name of column that should be present in all datasets containing time information. Default = "Date"

start_date

Date or characcter: Start date for final dataset in format "YYYY-MM-DD"

end_date

Date or character: End dat for final dataset in format "YYYY-MM-DD"

interval_days

Integer: Starting with start_date create timepoints every this many days. Default = 14

verbose

Logical: If TRUE, print messages to console. Default = TRUE

trace

Integer: If > 0 print additional info to console. Default = 1

Value

Merged data.table


egenn/rtemis documentation built on Oct. 28, 2024, 6:30 a.m.