Package 'OmopViewer'

Title: Visualise OMOP Results using 'shiny' Applications
Description: Visualise results obtained from analysing data mapped to the Observational Medical Outcomes Partnership (OMOP) common data model using 'shiny' applications.
Authors: Martí Català [aut, cre] , Yuchen Guo [aut] , Edward Burn [ctb] , Nuria Mercade-Besora [ctb] , Elin Rowlands [ctb] , Cecilia Campanile [ctb]
Maintainer: Martí Català <[email protected]>
License: Apache License (>= 2)
Version: 0.1.0
Built: 2024-10-22 07:23:21 UTC
Source: CRAN

Help Index


Create a 'bslib::card()' object from a '.md' file.

Description

Create a 'bslib::card()' object from a '.md' file.

Usage

cardFromMd(fileName)

Arguments

fileName

Name of the .md file.

Value

Ui 'bslib::card' with the background details.


Create a 'bslib::card()' object from a '<summarised_result>' object.

Description

Create a 'bslib::card()' object from a '<summarised_result>' object.

Usage

cardSummary(result)

Arguments

result

A '<summarised_result>' object.

Value

A 'bslib::card()' object.


Add the strata, group and additional columns to settings with the tidyColumns ('visOmopResults::splitGroup()', 'visOmopResults::splitStrata()', ‘visOmopResults::splitAdditional()') for each ’result_id'.

Description

Add the strata, group and additional columns to settings with the tidyColumns ('visOmopResults::splitGroup()', 'visOmopResults::splitStrata()', ‘visOmopResults::splitAdditional()') for each ’result_id'.

Usage

correctSettings(result)

Arguments

result

A '<summarised_result>' object.

Value

The summarised_result object with the settings corrected


Export and launch a static shiny specific to the provided results.

Description

Export and launch a static shiny specific to the provided results.

Usage

exportStaticApp(
  result,
  directory,
  logo = "ohdsi",
  title = "",
  background = TRUE,
  summary = TRUE,
  panels = list(),
  theme = NULL,
  open = rlang::is_interactive()
)

Arguments

result

A summarised_result object.

directory

Directory to create the shiny.

Name of a logo or path to a logo. If NULL no logo is included. Only svg format allowed for the moment.

title

title of the shiny

background

Whether to include a background panel. Background panel content will be controlled from the generated background.md file.

summary

Whether to include a panel with a summary of content in the 'result'.

panels

List specifying order of results. Each panel is determined by the available result types in the result object. Panels for any available results not specified will be included after the specified result tabs.

theme

Assign a theme to the shiny app using bslib::bs_theme()

open

Whether to open the shiny app project.

Value

The shiny app will be created in directory.

Examples

exportStaticApp(
  result = emptySummarisedResult(),
  directory = tempdir(),
  theme = "bslib::bs_theme(bg = '#bb0a1e', fg = '#0000ff')"
)

This function is used to filter data in shinys that inputs are defined following.

Description

This function is used to filter data in shinys that inputs are defined following.

Usage

filterData(result, resultType, input)

Arguments

result

A summarised_result object.

resultType

A resultType of interest to filter by.

input

Input of the shiny to filter by.

Value

The filtered result.


Get the different options that a summarised_result have.

Description

Get the different options that a summarised_result have.

Usage

getChoices(result, flatten = FALSE)

Arguments

result

A '<summarised_result>' object.

flatten

Whether to flatten to a single list or not.

Value

A named list with the options

Examples

library(CohortCharacteristics)

cdm <- mockCohortCharacteristics()

result <- cdm$cohort1 |>
  summariseCharacteristics()

getChoices(result)

Launch a dynamic shiny app where you can upload results.

Description

Launch a dynamic shiny app where you can upload results.

Usage

launchDynamicApp()

Value

Launches the shiny app.


Create a formatted gt table.

Description

Create a formatted gt table.

Usage

omopViewerTable(
  result,
  header = character(),
  group = character(),
  hide = character()
)

Arguments

result

A tibble it must contain at least two columns: estimate_value and estimate_type.

header

Column names to move to header, must be columns in result.

group

Column names to group by, must be columns in result.

hide

Column names to hide, must be columns in result.

Value

A gt table.


Get a tidy tibble from a 'summarised_result' object.

Description

Get a tidy tibble from a 'summarised_result' object.

Usage

tidyData(result)

Arguments

result

A 'summarised_result' object.

Value

A tibble.