Longitudinal view of results by visit with grouping and normal-range context.
The chart below is live — rendered by the safety.viz
resultsOverTime 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_results_over_time.yaml", package = "gsm.safety")
)
gsm.core::RunWorkflow(
lWorkflow = lWorkflow,
lData = list(dfResults = ExampleData("adbds"))
)
Rscript inst/examples/results-over-time.R <output-dir>
safety_results_over_time.yaml workflow
meta:
Type: Report
ID: safety_results_over_time
Output: html
Name: Safety Results Over Time Report
Description: Interactive safety.viz results-over-time chart of long-format labs and vitals across visits.
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: SITEID
label: Site
group_by: ARM
spec:
dfResults:
USUBJID:
type: character
TEST:
type: character
VISIT:
type: character
STRESN:
type: numeric
steps:
- output: strOutputDir
name: getwd
- output: lWidget
name: gsm.safety::Widget_ResultsOverTime
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_ResultsOverTime(
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 = "SITEID", label = "Site")
),
group_by = "ARM"
)
)