PhenotypeR

CRAN status R-CMD-check Lifecycle:Experimental

The PhenotypeR package helps us to assess the research-readiness of a set of cohorts we have defined. This assessment includes:

Installation

You can install PhenotypeR from GitHub:

# install.packages("remotes")
remotes::install_github("ohdsi/PhenotypeR")

Example usage

library(omopgenerics)
library(CDMConnector)
library(PhenotypeR)
library(CohortConstructor)
library(dplyr)

con <- DBI::dbConnect(duckdb::duckdb(dbdir = CDMConnector::eunomiaDir()))
cdm <- CDMConnector::cdmFromCon(con = con,
                      cdmSchema = "main",
                      writeSchema = "main")

cdm$gibleed <- conceptCohort(cdm = cdm,
                                   conceptSet = list(gibleed = 192671L),
                                   name = "gibleed")

result <- cdm$gibleed |>
   phenotypeDiagnostics()
summary(result)
#> A summarised_result object with 22475 rows, 43 different result_id, 1 different
#> cdm names, and 26 settings.
#> CDM names: An OMOP CDM database.
#> Settings: result_type, package_name, package_version, group, strata,
#> additional, min_cell_count, analysis, analysis_complete_database_intervals,
#> analysis_full_contribution, analysis_outcome_washout, analysis_repeated_events,
#> analysis_type, cdm_version, cohort_definition_id, denominator_age_group,
#> denominator_days_prior_observation, denominator_end_date, …, type, and
#> vocabulary_version.

Once we have our results we can quickly view them in an interactive application. This shiny app will be saved in a new directory and can be further customised.

shinyDiagnostics(result = result, directory = tempdir())