Participant-level trajectories over time for spotting outliers per measure.
The chart below is live — rendered by the safety.viz
outlierExplorer module on the package’s example data, with
the full control sidebar.
The same chart ships as a gsm-idiom report workflow. Run it with
gsm.core::RunWorkflow() to produce a standalone HTML
report, or use the matching runner script:
lWorkflow <- yaml::read_yaml(
system.file("workflow", "3_reports", "safety_outlier_explorer.yaml", package = "gsm.safety")
)
gsm.core::RunWorkflow(
lWorkflow = lWorkflow,
lData = list(dfResults = ExampleData("adbds"))
)
Rscript inst/examples/outlier-explorer.R <output-dir>
safety_outlier_explorer.yaml workflow
meta:
Type: Report
ID: safety_outlier_explorer
Output: html
Name: Safety Outlier Explorer Report
Description: Interactive safety.viz outlier explorer of long-format labs and vitals results.
lSettings:
filters:
- value_col: SITEID
label: Site ID
- value_col: SEX
label: Sex
- value_col: RACE
label: Race
- value_col: ARM
label: Treatment Group
groups:
- value_col: ARM
label: Treatment Group
- value_col: SEX
label: Sex
- value_col: RACE
label: Race
- value_col: SITE
label: Site
details:
- value_col: USUBJID
label: Participant ID
- value_col: STRESN
label: Result
- value_col: SEX
label: Sex
- value_col: RACE
label: Race
- value_col: ARM
label: Treatment Group
spec:
dfResults:
USUBJID:
type: character
TEST:
type: character
STRESN:
type: numeric
steps:
- output: strOutputDir
name: getwd
- output: lWidget
name: gsm.safety::Widget_OutlierExplorer
params:
dfResults: dfResults
lSettings: lSettings
- output: strReportPath
name: gsm.safety::SaveWidgetReport
params:
widget: lWidget
strOutputDir: strOutputDir
strOutputFile: ID
library(gsm.safety)
dfResults <- ExampleData("adbds")
Widget_OutlierExplorer(
dfResults,
lSettings = list(
filters = list(
list(value_col = "SITEID", label = "Site ID"),
list(value_col = "SEX", label = "Sex"),
list(value_col = "RACE", label = "Race"),
list(value_col = "ARM", label = "Treatment Group")
),
groups = list(
list(value_col = "ARM", label = "Treatment Group"),
list(value_col = "SEX", label = "Sex"),
list(value_col = "RACE", label = "Race"),
list(value_col = "SITE", label = "Site")
),
details = list(
list(value_col = "USUBJID", label = "Participant ID"),
list(value_col = "STRESN", label = "Result"),
list(value_col = "SEX", label = "Sex"),
list(value_col = "RACE", label = "Race"),
list(value_col = "ARM", label = "Treatment Group")
)
)
)