Skip to contents

CDM Object

Create or transform a CDM reference object. These accept and return cdm objects.

assert_tables() assertTables()
Assert that tables exist in a cdm object
assert_write_schema() assertWriteSchema()
Assert that cdm has a writable schema
`$`(<cdm_reference>)
Subset a cdm reference object
cdmDisconnect() cdm_disconnect()
Disconnect the connection of the cdm object
cdmFlatten() cdm_flatten()
Flatten a cdm into a single observation table
cdmName() cdm_name()
Get the CDM name
cdmSample() cdm_sample()
Subset a cdm object to a random sample of individuals
cdmSubset() cdm_subset()
Subset a cdm object to a set of persons
cdmSubsetCohort() cdm_subset_cohort()
Subset a cdm to the individuals in one or more cohorts
cdm_from_con() cdmFromCon()
Create a CDM reference object from a database connection
cdm_from_environment()
Create a CDM object from a pre-defined set of environment variables
cdm_from_files() cdmFromFiles()
Create a CDM reference from a folder containing parquet, csv, or feather files
cdm_select_tbl()
Select a subset of tables in a cdm reference object
collect(<cdm_reference>)
Bring a remote CDM reference into R
copy_cdm_to() copyCdmTo()
Copy a cdm object from one database to another
dropTable() drop_table()
Drop tables from write_schema of a cdm object
insertTable() insert_table()
Add tables to a cdm object
print(<cdm_reference>)
Print a CDM reference object
snapshot()
Extract CDM metadata
stow()
Collect a list of lazy queries and save the results as files
`[`(<cdm_reference>)
Subset a cdm reference object
`[[`(<cdm_reference>)
Subset a cdm reference object
tbl_group() tblGroup()
CDM table selection helper
validate_cdm() validateCdm()
Validation report for a CDM
version()
Get the CDM version

Cohort Creation and Transformation

A cohort is a set of person-days representing the time during which people in a CDM exhibited some observable characteristics. Cohorts are often the foundation of downstream analyses.

cohortAttrition() cohort_attrition()
Get attrition table from a GeneratedCohortSet object
cohortCount() cohort_count()
Get cohort counts from a GeneratedCohortSet object
settings() cohort_set()
Get cohort settings from a GeneratedCohortSet object
cohort_erafy() cohortErafy()
Collapse cohort records within a certain number of days
cohort_union() cohortUnion()
Union all cohorts in a cohort set with cohorts in a second cohort set
generateCohortSet() generate_cohort_set()
Generate a cohort set on a cdm object
generateConceptCohortSet() generate_concept_cohort_set()
Create a new generated cohort set from a list of concept sets
intersect_cohorts() intersectCohorts()
Intersect all cohorts in a single cohort table
new_generated_cohort_set() newGeneratedCohortSet()
Constructor for GeneratedCohortSet objects
read_cohort_set() readCohortSet()
Read a set of cohort definitions into R
recordCohortAttrition() record_cohort_attrition()
Add attrition reason to a GeneratedCohortSet object
union_cohorts() unionCohorts()
Union all cohorts in a single cohort table

dbplyr workarounds

Functions that can be used in cross database dplyr pipelines

appendPermanent() append_permanent()
Run a dplyr query and add the result set to an existing
asDate() as_date()
as.Date dbplyr translation wrapper
computeQuery() compute_query()
Execute dplyr query and save result in remote database
dateadd()
Add days or years to a date in a dplyr query
datediff()
Compute the difference between two days
datepart()
Extract the day, month or year of a date in a dplyr pipeline
inSchema() in_schema()
Helper for working with compound schemas
summarise_quantile() summarize_quantile() summariseQuantile() summarizeQuantile()
Quantile calculation using dbplyr
uniqueTableName() unique_table_name()
Create a unique table name for temp tables

DBI connection

Functions that accept DBI connections and are useful in cross database DBI code

dbms()
Get the database management system (dbms) from a cdm_reference or DBI connection
list_tables() listTables()
List tables in a schema

Eunomia example CDM

Easily create and use example CDMs in a duckdb database

downloadEunomiaData() download_eunomia_data()
Download Eunomia data files
eunomiaDir() eunomia_dir()
Create a copy of an example OMOP CDM dataset
eunomia_is_available() eunomiaIsAvailable()
Has the Eunomia dataset been cached?
exampleDatasets() example_datasets()
List the available example CDM datasets