summariseRecordCount {OmopSketch} | R Documentation |
Summarise record counts of an omop_table using a specific time interval. Only records that fall within the observation period are considered.
Description
Summarise record counts of an omop_table using a specific time interval. Only records that fall within the observation period are considered.
Usage
summariseRecordCount(
cdm,
omopTableName,
interval = "overall",
ageGroup = NULL,
sex = FALSE,
sample = NULL,
dateRange = NULL
)
Arguments
cdm |
A cdm_reference object. |
omopTableName |
A character vector of omop tables from the cdm. |
interval |
Time interval to stratify by. It can either be "years", "quarters", "months" or "overall". |
ageGroup |
A list of age groups to stratify results by. |
sex |
Whether to stratify by sex (TRUE) or not (FALSE). |
sample |
An integer to sample the tables to only that number of records. If NULL no sample is done. |
dateRange |
A list containing the minimum and the maximum dates defining the time range within which the analysis is performed. |
Value
A summarised_result object.
Examples
library(dplyr, warn.conflicts = FALSE)
cdm <- mockOmopSketch()
summarisedResult <- summariseRecordCount(
cdm = cdm,
omopTableName = c("condition_occurrence", "drug_exposure"),
interval = "years",
ageGroup = list("<=20" = c(0,20), ">20" = c(21, Inf)),
sex = TRUE
)
summarisedResult |>
glimpse()
PatientProfiles::mockDisconnect(cdm = cdm)
[Package OmopSketch version 0.2.0 Index]