Learn R Programming

⚠️There's a newer version (2.1.1) of this package.Take me there.

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

270

Version

2.0.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jeremy Wildfire

Last Published

September 22nd, 2021

Functions in safetyGraphics (2.0.0)

hasField

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

Server for the filter module in datamods::filter_data_ui
makeMapping

Create data mapping based on data standards and user input
makeChartConfig

Make Chart Config
safetyGraphicsInit

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

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

Run the core safetyGraphics App
makeChartSummary

html chart summary
settingsChartsUI

UI for settings tab showing details for the charts loaded in the app
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
mappingDomain

Server that facilitates the mapping of a full data domain
setMappingListValue

Set the value for a given named parameter
loadData

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

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

UI for the home module
mappingColumn

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

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

Server for mapping tab covering of all data domains
mappingSelect

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

UI for mapping tab covering of all data domains
mappingSelectUI

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

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

Convert mapping data.frame to a list
chartsTab

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

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

Prepare a chart object for safetyGraphics
meta

Metadata data frame containing information about the data mapping used to configure safetyGraphics charts. One record per unique data mapping
settingsCharts

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

Server for the setting page
settingsMappingUI

UI for settings tab showing current mapping
settingsData

Server for settings tab showing current data
settingsTabUI

UI for the settings tab
textKeysToList

Helper function to convert keys from text to nested lists
settingsMapping

Server for settings tab showing current mapping
makeChartParams

Make Chart Parameters
makeChartExport

Make Chart Export
safetyGraphicsServer

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

UI for settings tab showing current data
safetyGraphicsUI

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

Check whether a column is found in a data set
SafetyGraphics

safetyGraphics package
chartsTabUI

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

Evaluate a data set against a data standard
filterTab

Server for the filter module in datamods::filter_data_ui
filterTabUI

UI for the filter module in datamods::filter_data_ui
filterTabChecks

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

Detect the data standard used for a data set
app_startup

Startup code for shiny app
chartsNav

Adds a navbar tab that initializes the Chart Module UI