View source: R/shinyDiagnostics.R
| shinyDiagnostics | R Documentation |
A shiny app that is designed for any diagnostics results from phenotypeR, this includes:
* A diagnostics on the database via 'databaseDiagnostics'. * A diagnostics on the cohort_codelist attribute of the cohort via 'codelistDiagnostics'. * A diagnostics on the cohort via 'cohortDiagnostics'. * A diagnostics on the population via 'populationDiagnostics'. * A diagnostics on the matched cohort via 'matchedDiagnostics'.
shinyDiagnostics(
result,
directory,
minCellCount = 5,
open = rlang::is_interactive(),
expectations = NULL
)
result |
A summarised result |
directory |
Directory where to save report |
minCellCount |
Minimum cell count for suppression when exporting results. |
open |
If TRUE, the shiny app will be launched in a new session. If FALSE, the shiny app will be created but not launched. |
expectations |
Data frame or tibble with cohort expectations. It must contain the following columns: cohort_name, estimate, value, and source. |
A shiny app
library(omock)
library(CohortConstructor)
library(PhenotypeR)
cdm <- mockCdmFromDataset(source = "duckdb")
cdm$warfarin <- conceptCohort(cdm,
conceptSet = list(warfarin = c(1310149L,
40163554L)),
name = "warfarin")
result <- phenotypeDiagnostics(cdm$warfarin)
expectations <- dplyr::tibble("cohort_name" = "warfarin",
"value" = c("Mean age",
"Male percentage",
"Survival probability after 5y"),
"estimate" = c("32", "74%", "4%"),
"source" = c("AlbertAI"))
shinyDiagnostics(result, tempdir(), expectations = expectations)
CDMConnector::cdmDisconnect(cdm = cdm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.