Learn R Programming

safetyGraphics: Clinical Trial Monitoring with R

The {safetyGraphics} package provides a framework for evaluating of clinical trial safety in R using a flexible data pipeline. The package includes a shiny application that allows users to explore safety data using a series of interactive graphics, including the hepatic safety explorer shown below. The package has been developed as part of the Interactive Safety Graphics (ISG) workstream of the ASA Biopharm-DIA Safety Working Group.

Using the app

A demo of the app using sample data is available here or can be initialized as follows:

install.packages("safetyGraphics")
library("safetyGraphics")
safetyGraphicsApp() #open the shiny application

The most common workflow is for a user to initialize the app with their data, adjust settings as needed, and view the interactive charts. Finally, the user can share any chart by exporting its source code or by generating a self-contained, fully reproducible report that can be shared with others.

Instructions for loading study data are provided in the introductory vignette and more complex customizations are provided in the cookbook vignette.

Charts

The app is built to support a wide variety of chart types including static plots (e.g. from {ggplot2}), shiny modules, {htmlwidgets} and even static outputs like RTFs. Several pre-configured charts are included in the companion {safetyCharts} R Package, and are available by default in the app. Other charts can be added using the process descibed in this vignette.

Copy Link

Version

Install

install.packages('safetyGraphics')

Monthly Downloads

277

Version

2.1.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jeremy Wildfire

Last Published

December 14th, 2022

Functions in safetyGraphics (2.1.1)

homeTab

Server for the filter module in datamods::filter_data_ui
hasColumn

Check whether a column is found in a data set
loadCharts

Server for the chart loading module used in safetyGraphicsInit()
generateMappingList

Convert mapping data.frame to a list
loadChartsUI

UI for the chart loading module used in safetyGraphicsInit()
hasField

Check whether a specified field value is found in a data set
mappingColumnUI

UI that facilitates the mapping of a column data (and any associated fields)
makeChartSummary

html chart summary
mappingDomain

Server that facilitates the mapping of a full data domain
loadData

Server for the data loading module used in safetyGraphicsInit()
makeChartExport

Make Chart Export
makeChartParams

Make Chart Parameters
loadDataUI

UI for the data loading module used in safetyGraphicsInit()
makeMapping

Create data mapping based on data standards and user input
safetyGraphicsApp

Run the core safetyGraphics App
prepareChart

Prepare a chart object for safetyGraphics
settingsTab

Server for the setting page
mappingSelectUI

UI that facilitates the mapping of a single data element (column or field) with a simple select UI
mappingTab

Server for mapping tab covering of all data domains
settingsTabUI

UI for the settings tab
setMappingListValue

Set the value for a given named parameter
makeMeta

Create a metadata object table for a set of charts
safetyGraphicsUI

UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.
mappingColumn

Server that facilitates the mapping of a column data (and any associated fields)
safetyGraphicsInit

App to select charts, load data and then initialize the core safetyGraphics app
safetyGraphicsServer

Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.
makeChartConfig

Make Chart Config
mappingSelect

Server that facilitates the mapping of a single data element (column or field) with a simple select UI
settingsMapping

Server for settings tab showing current mapping
%>%

Pipe operator
settingsCodeUI

UI for settings tab providing code to re-start the app with current data/settings
settingsData

Server for settings tab showing current data
settingsCode

Server for settings tab providing code to re-start the app with current data/settings
mappingDomainUI

UI that facilitates the mapping of a full data domain
settingsCharts

Server for settings tab showing details for the charts loaded in the app
mappingTabUI

UI for mapping tab covering of all data domains
settingsMappingUI

UI for settings tab showing current mapping
textKeysToList

Helper function to convert keys from text to nested lists
settingsDataUI

UI for settings tab showing current data
settingsChartsUI

UI for settings tab showing details for the charts loaded in the app
evaluateStandard

Evaluate a data set against a data standard
chartsNav

Adds a navbar tab that initializes the Chart Module UI
filterTab

Server for the filter module in datamods::filter_data_ui
filterTabUI

UI for the filter module in datamods::filter_data_ui
chartsTabUI

UI for chart module, designed to be re-used for each chart generated.
app_startup

Startup code for shiny app
filterTabChecks

Checks for whether the current data and settings support a filter tab
chartsTab

Server for chart module, designed to be re-used for each chart generated.
detectStandard

Detect the data standard used for a data set
SafetyGraphics

safetyGraphics package
homeTabUI

UI for the home module