Learn R Programming

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

safetyGraphics: Clinical Trial Safety Graphics with R

The safetyGraphics package provides a framework for evaluation of clinical trial safety in R. It includes several safety-focused visualizations to empower clinical data monitoring. Chief among these is the Hepatic Explorer, based on the Evaluation of the Drug-Induced Serious Hepatotoxicity (eDish) visualization. A demo of the Hepatic Explorer interactive graphic is available here and is shown below.

This package is being built in conjunction with the hep-explorer javascript library.

Usage

Users can interactively explore their data with a shiny application or create standalone interactive charts.

Shiny application

The Shiny app provides a simple interface for:

  • Loading data
  • Customizing settings and data mappings
  • Viewing and exporting the interactive graphics
devtools::install_github("SafetyGraphics/safetyGraphics")
library("safetyGraphics")
safetyGraphicsApp() #open the shiny application

Standalone charts

Users can also initialize customized standalone charts with a few lines of code.

devtools::install_github("safetyGraphics/safetyGraphics")
library("safetyGraphics")

settings <- list(
  id_col = "USUBJID",
  value_col = "AVAL",
  measure_col = "PARAM",
  visit_col = "VISIT",
  visitn_col = "VISITNUM",
  studyday_col = "ADY",
  normal_col_low = "A1LO",
  normal_col_high = "A1HI",
  measure_values = list(ALT = "Alanine Aminotransferase (U/L)",
                        AST = "Aspartate Aminotransferase (U/L)",
                        TB = "Bilirubin (umol/L)",
                        ALP = "Alkaline Phosphatase (U/L)")
  )

chartRenderer(data=adlbc, settings=settings, chart="hepexplorer")

Copy Link

Version

Install

install.packages('safetyGraphics')

Monthly Downloads

277

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jeremy Wildfire

Last Published

January 15th, 2020

Functions in safetyGraphics (1.1.0)

removeSettings

Remove a setting from the safetyGraphics shiny app
getSettingValue

Retrieve the value for a given named parameter
evaluateStandard

Evaluate a data set against a data standard
generateShell

Generate a default settings shell based on settings metadata
safetyGraphicsApp

Run the interactive safety graphics builder
generateSettings

Generate a settings object based on a data standard
removeCharts

Remove a chart from the safetyGraphics shiny app
checkColumn

Check that a setting parameter has a matching data column
setSettingsValue

Set the value for a given named parameter
detectStandard

Detect the data standard used for a data set
checkRequired

Check that the user has provided a valid for a given settings parameter
createChart

Create a custom static or plotly R graphic
trimData

Removes unnecessary rows and columns
textKeysToList

Helper function to convert keys from text to nested lists
getRequiredSettings

Get a list of required settings
validateSettings

Compare a settings object with a specified data set
standardsMetadata

Standards Metadata
getSettingKeys

Get setting keys matching a pattern
settingsMetadata

Settings Metadata
trimSettings

Subset a settings object to those relevant for a list of charts
getSettingsMetadata

Get metadata about chart settings
hasColumn

Check whether a column is found in a data set
hasField

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

Charts Metadata
chartRenderer

Create an interactive graphics widget
chartRenderer-shiny

Shiny bindings for chartRenderer
addSetting

Adds a new setting for use in the safetyGraphics shiny app
checkField

Check that a setting parameter has a matching data field
addChart

Adds a new chart for use in the safetyGraphics shiny app
SafetyGraphics

safetyGraphics package
checkNumeric

Check that settings for mapping numeric data are associated with numeric columns
adlbc

Safety measures sample data