Learn R Programming

safetyGraphics (version 0.7.3)

eDISH: Create an eDISH widget

Description

This function creates an interactive graphic for the Evaluation of Drug-Induced Serious Hepatotoxicity (eDISH)

Usage

eDISH(data, id_col = "USUBJID", value_col = "STRESN",
  measure_col = "TEST", normal_col_low = "STNRLO",
  normal_col_high = "STNRHI", visit_col = "VISIT",
  visitn_col = "VISITN", studyday_col = "DY", baseline = NULL,
  filters = NULL, group_cols = NULL, analysisFlag = NULL,
  measure_values = list(ALT = "Aminotransferase, alanine (ALT)", AST =
  "Aminotransferase, aspartate (AST)", TB = "Total Bilirubin", ALP =
  "Alkaline phosphatase (ALP)"), x_options = c("ALT", "AST", "ALP"),
  y_options = "TB", visit_window = 30, r_ratio_filter = TRUE,
  r_ratio_cut = 0, showTitle = TRUE, debug_js = FALSE,
  warningText = NULL, settings = NULL)

Arguments

data

A data frame containing the labs data. Data must be structured as one record per study participant per time point per lab measure.

id_col

Unique subject identifier variable name. Default: "USUBJID".

value_col

Lab result variable name. Default: "STRESN".

measure_col

Lab measure variable name. Default: "TEST".

normal_col_low

Lower limit of normal variable name. Default: "STNRLO".

normal_col_high

Upper limit of normal variable name. Default: "STNRHI".

visit_col

Visit variable name. Default: "VISIT".

visitn_col

Visit number variable name. Default: "VISITN".

studyday_col

Visit day variable name. Default: "DY".

baseline

An optional list defining which column "value_col" and values (one or more) values represent the baseline visit(s) of the study.

filters

An optional list of specifications for filters. Each filter is a nested, named list (containing the filter value column: "value_col" and associated label: "label") within the larger list. Default: NULL.

group_cols

An optional list of specifications for grouping columns. Each group column is a nested, named list (containing the group variable column: "value_col" and associated label: "label") within the larger list. Default: NULL.

analysisFlag

An optional list defining which column value_col and values values should be used to records for use in eDish and mDish analyses. Default: NULL.

measure_values

A list defining the data values from measure_col for the lab measures used in eDish evaluations. Default: list(ALT = 'Aminotransferase, alanine (ALT)', AST = 'Aminotransferase, aspartate (AST)', TB = 'Total Bilirubin', ALP = 'Alkaline phosphatase (ALP)').

x_options

Specifies variable options for the x-axis using the key values from measure_values (e.g. "ALT"). When multiple options are specified, a control allowing the user to interactively change the x variable is shown. Default: c("ALT", "AST", "ALP").

y_options

Specifies variable options for the y-axis using the key values from measure_values (e.g. "TB"). When multiple options are specified, a control allowing the user to interactively change the y variable is shown. Default: c("TB", "ALP").

visit_window

Default visit window used to highlight eDish points where x and y measures occurred within the specified number of days. Editable by user after render. Default: 30.

r_ratio_filter

Specifies whether the R Ratio filter should be shown. R ratio is defined as: (ALT value/ULN for ALT) / (ALP value/ULN for ALP). Default: TRUE.

r_ratio_cut

Default cut point for R Ratio filter. Ignored when r_ratio_filter = FALSE. User can update this setting via the UI when r_ratio_filter = TRUE. Default: 0.

showTitle

Specifies whether the title should be drawn above the controls. Default: TRUE.

debug_js

print settings in javascript before rendering chart. Default: FALSE.

warningText

Informational text to be displayed near the top of the controls (beneath the title, if any). No warning is displayed if warningText = "". If warningText = NULL, default warning text will be displayed ("Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures.").

settings

Optional list of settings arguments to be converted to JSON using jsonlite::toJSON(settings, auto_unbox = TRUE, dataframe = "rows", null = "null"). If provided, all other function parameters are ignored. Default: NULL.

Examples

Run this code
# NOT RUN {
## Create eDISH figure customized to user data
eDISH(data=adlbc, 
      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)"))

## Create eDISH figure using a premade settings list
group_cols_list <- list(
  list(value_col = "TRTP", label = "Treatment"),
  list(value_col = "SEX", label = "Sex"), 
  list(value_col = "AGEGR1", label = "Age group")
)


filters_list <- list(
  list(value_col = "TRTA", label = "Treatment"),
  list(value_col = "SEX", label = "Sex"), 
  list(value_col = "RACE", label = "RACE"),
  list(value_col = "AGEGR1", label = "Age group")
)

settingsl <- 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", 
      group_cols = group_cols_list,
      filters = filters_list,
      measure_values = list(ALT = "Alanine Aminotransferase (U/L)",
                            AST = "Aspartate Aminotransferase (U/L)",
                            TB = "Bilirubin (umol/L)",
                            ALP = "Alkaline Phosphatase (U/L)"))
eDISH(data=adlbc, settings = settingsl)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab