hepExplorer {safetyCharts}R Documentation

Make standalone hepExplorer html widget

Description

Convience mapping of render_widget for hepExplorer.

Usage

hepExplorer(df = safetyData::adam_adlbc, mapping = NULL, ...)

Arguments

df

data frame containing lab data used to render for hepExplorer. Default is safetyData::adam_adlbc.

mapping

named list with the current data mappings. See details for default mapping.

...

additional options to be added to mapping. Will overwrite mapping.

Details

The data and mapping should match the specs described in the hepExplorer javascript library. Items passed in ... are added to mapping, and then the list is converted to json via jsonlite::toJSON(mapping, auto_unbox=TRUE, null="null").

The default mapping shown below is designed to work with data in the CDISC ADaM format (like safetydata::adam_adlbc).

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

Parameters that are not included in the default mapping can be accessed via ...; Key options and defaults for safetyData::adam_adlbc shown below:

For more options see the full specs in the javascript library.

Examples

## Not run: 
# Render widget with defaults
hepExplorer() 

# Add age group to default
hepExplorer(group_cols=c("SEX","AGEGR1")) 

# Enable interactive y-axis
hepExplorer(y_options='all') 

# Use custom mapping for SDTM data
hepExplorer(
    df=safetyData::sdtm_lb,
    measure_col = "LBTEST", 
    measure_values = list(
        ALT = "Alanine Aminotransferase", 
        AST = "Aspartate Aminotransferase", 
        TB = "Bilirubin",
        ALP = "Alkaline Phosphatase"
    ), 
    id_col = "USUBJID", 
    value_col = "LBSTRESN", 
    normal_col_low = "LBORNRLO",                    
    normal_col_high = "LBORNRHI", 
    studyday_col = "LBDY", 
    visit_col = "VISIT",
    visitn_col = "VISITNUM"
)

## End(Not run)


[Package safetyCharts version 0.3.0 Index]