Learn R Programming

OmopConstructor (version 0.2.0)

buildDrugEra: Build the drug_era table

Description

Build the drug_era table

Usage

buildDrugEra(cdm, collapseDays = 30L)

Value

The lazy drug_era table.

Arguments

cdm

A cdm_reference object.

collapseDays

Number of days that two exposures can be separated to be collapsed in a single era.

Examples

Run this code
# \donttest{
library(omock)
library(OmopConstructor)
library(dplyr, warn.conflicts = TRUE)

cdm <- mockCdmFromDataset(datasetName = "GiBleed", source = "duckdb")

cdm$drug_era <- buildDrugEra(cdm = cdm)
cdm$drug_era |>
  glimpse()

# }

Run the code above in your browser using DataLab