oxford-pharmacoepi / omopViewer

https://oxford-pharmacoepi.github.io/omopViewer/
Apache License 2.0
0 stars 0 forks source link

omopViewer

R-CMD-check CRAN
status Lifecycle:
experimental Codecov test
coverage

[!IMPORTANT] This package is under construction and this is just a first Beta release, please use it carefully and report any issue that you encounter using it.

The goal of omopViewer is to allow the user to easily create Shiny Apps to visualise study results in <summarised_result> format.

Installation

You can install the development version of omopViewer from GitHub with:

install.packages("pak")
pak::pkg_install("oxford-pharmacoepi/omopViewer")

Main functionalities

library(omopViewer)

The package can be divided in 3 main functionalities: - Static shiny app - Dynamic shiny app - Utility functions

Static shiny app

The static shiny app functionality creates a static shiny from a list of summarised_result objects. This shiny is specific to the set of results and can be modified later locally.

# lets generate some results
library(CohortCharacteristics)
cdm <- mockCohortCharacteristics()
#> Note: method with signature 'DBIConnection#Id' chosen for function 'dbExistsTable',
#>  target signature 'duckdb_connection#Id'.
#>  "duckdb_connection#ANY" would also be valid
#> ! cohort columns will be reordered to match the expected order:
#>   cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date.
#> ! cohort columns will be reordered to match the expected order:
#>   cohort_definition_id, subject_id, cohort_start_date, and cohort_end_date.
result <- summariseCharacteristics(cdm$cohort1) |>
  bind(summariseCohortAttrition(cdm$cohort1))
#> ℹ adding demographics columns
#> ℹ summarising data
#> ✔ summariseCharacteristics finished!

exportStaticApp(result = result)
#> ℹ Processing data
#> ✔ Data processed: 2 result types idenfied: `summarise_characteristics` and
#>   `summarise_cohort_attrition`.
#> ℹ Creating shiny from provided data
#> ✔ Shiny created in: /Users/martics/Documents/GitHub/omopViewer/shiny

Dynamic shiny app

The dynamic shiny app can be easily launched with launchDynamicApp() function. This function creates a shinyApp where you can upload multiple results sets and visualise them.

launchDynamicApp()

Utility functions