| Title: | Interactive Box Plot |
|---|---|
| Description: | Interactive box plot using 'plotly' for clinical trial analysis. |
| Authors: | Yujie Zhao [aut, cre], Benjamin Wang [aut], Yilong Zhang [ctb], Nan Xiao [ctb], Hiroaki Fukuda [ctb], Sarad Nepal [ctb], Madhusudhan Ginnaram [ctb], Venkatesh Burla [ctb], Merck Sharp & Dohme Corp [cph] |
| Maintainer: | Yujie Zhao <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.2 |
| Built: | 2026-10-12 16:30:15 UTC |
| Source: | https://github.com/merck/boxly |
Create an interactive box plot
boxly( outdata, color = NULL, hover_summary_var = c("n", "min", "q1", "median", "mean", "q3", "max"), hover_outlier_label = c("Participant ID", "Parameter value"), x_label = "Visit", y_label = "Change", heading_select_list = "Lab parameter", heading_summary_table = "Number of Participants" )boxly( outdata, color = NULL, hover_summary_var = c("n", "min", "q1", "median", "mean", "q3", "max"), hover_outlier_label = c("Participant ID", "Parameter value"), x_label = "Visit", y_label = "Change", heading_select_list = "Lab parameter", heading_summary_table = "Number of Participants" )
outdata |
An |
color |
Color for box plot. |
hover_summary_var |
A character vector of statistics to be displayed on hover label of box. |
hover_outlier_label |
A character vector of hover label for outlier.
A label from an input data is used if |
x_label |
x-axis label. |
y_label |
y-axis label. |
heading_select_list |
Select list menu label. |
heading_summary_table |
Summary table label. |
Interactive box plot.
# Only run this example in interactive R sessions if (interactive()) { analysis_plan <- metalite::plan( analysis = "boxly", population = "apat", observation = "wk12", parameter = "SODIUM;BILI" ) meta <- metalite::meta_adam( population = boxly_adsl, observation = boxly_adlb ) |> metalite::define_plan(analysis_plan) |> metalite::define_population( name = "apat", group = "TRTA", subset = SAFFL == "Y", label = "Safety Population" ) |> metalite::define_observation( name = "wk12", group = "TRTA", var = "PARAM", subset = AVISITN <= 12 & !is.na(CHG), label = "Weeks 0 to 12" ) |> metalite::define_parameter( name = "SODIUM", label = "Sodium (mmol/L)", subset = PARAMCD == "SODIUM" ) |> metalite::define_parameter( name = "BILI", label = "Bilirubin (mg/dL)", subset = PARAMCD == "BILI" ) |> metalite::define_analysis( name = "boxly", label = "Interactive Box Plot", x = "AVISITN", y = "CHG" ) |> metalite::meta_build() meta |> prepare_boxly() |> boxly() }# Only run this example in interactive R sessions if (interactive()) { analysis_plan <- metalite::plan( analysis = "boxly", population = "apat", observation = "wk12", parameter = "SODIUM;BILI" ) meta <- metalite::meta_adam( population = boxly_adsl, observation = boxly_adlb ) |> metalite::define_plan(analysis_plan) |> metalite::define_population( name = "apat", group = "TRTA", subset = SAFFL == "Y", label = "Safety Population" ) |> metalite::define_observation( name = "wk12", group = "TRTA", var = "PARAM", subset = AVISITN <= 12 & !is.na(CHG), label = "Weeks 0 to 12" ) |> metalite::define_parameter( name = "SODIUM", label = "Sodium (mmol/L)", subset = PARAMCD == "SODIUM" ) |> metalite::define_parameter( name = "BILI", label = "Bilirubin (mg/dL)", subset = PARAMCD == "BILI" ) |> metalite::define_analysis( name = "boxly", label = "Interactive Box Plot", x = "AVISITN", y = "CHG" ) |> metalite::meta_build() meta |> prepare_boxly() |> boxly() }
Definition of each variable can be found in https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
boxly_adegboxly_adeg
A data frame with 32139 and 35 variables:
https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
Definition of each variable can be found in https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
boxly_adlbboxly_adlb
A data frame with 24746 and 24 variables:
https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
A dataset containing the demographic information of a clinical trial following CDISC ADaM standard.
boxly_adslboxly_adsl
A data frame with 254 rows and 51 variables.
Definition of each variable can be found in https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
Definition of each variable can be found in https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
boxly_advsboxly_advs
A data frame with 32139 and 34 variables:
https://github.com/phuse-org/phuse-scripts/tree/master/data/adam/cdisc
Prepare data for interactive box plot
prepare_boxly( meta, population = NULL, observation = NULL, analysis = NULL, filter_var = "PARAM", hover_var_outlier = c("USUBJID", metalite::collect_adam_mapping(meta, analysis)$y) )prepare_boxly( meta, population = NULL, observation = NULL, analysis = NULL, filter_var = "PARAM", hover_var_outlier = c("USUBJID", metalite::collect_adam_mapping(meta, analysis)$y) )
meta |
A metadata object created by metalite. |
population |
A character value of population term name. The term name is used as key to link information. |
observation |
A character value of observation term name. The term name is used as key to link information. |
analysis |
A character value of analysis term name. The term name is used as key to link information. |
filter_var |
A character value of variable name used for filtering. Default is "PARAM". |
hover_var_outlier |
A character vector of hover variables for outlier. |
Metadata list with plotting dataset.
Metadata list with plotting dataset
analysis_plan <- metalite::plan( analysis = "boxly", population = "apat", observation = "wk12", parameter = "SODIUM;BILI" ) meta <- metalite::meta_adam( population = boxly_adsl, observation = boxly_adlb ) |> metalite::define_plan(analysis_plan) |> metalite::define_population( name = "apat", group = "TRTA", subset = SAFFL == "Y", label = "Safety Population" ) |> metalite::define_observation( name = "wk12", group = "TRTA", var = "PARAM", subset = AVISITN <= 12 & !is.na(CHG), label = "Weeks 0 to 12" ) |> metalite::define_parameter( name = "SODIUM", label = "Sodium (mmol/L)", subset = PARAMCD == "SODIUM" ) |> metalite::define_parameter( name = "BILI", label = "Bilirubin (mg/dL)", subset = PARAMCD == "BILI" ) |> metalite::define_analysis( name = "boxly", label = "Interactive Box Plot", x = "AVISITN", y = "CHG" ) |> metalite::meta_build() prepare_boxly(meta)analysis_plan <- metalite::plan( analysis = "boxly", population = "apat", observation = "wk12", parameter = "SODIUM;BILI" ) meta <- metalite::meta_adam( population = boxly_adsl, observation = boxly_adlb ) |> metalite::define_plan(analysis_plan) |> metalite::define_population( name = "apat", group = "TRTA", subset = SAFFL == "Y", label = "Safety Population" ) |> metalite::define_observation( name = "wk12", group = "TRTA", var = "PARAM", subset = AVISITN <= 12 & !is.na(CHG), label = "Weeks 0 to 12" ) |> metalite::define_parameter( name = "SODIUM", label = "Sodium (mmol/L)", subset = PARAMCD == "SODIUM" ) |> metalite::define_parameter( name = "BILI", label = "Bilirubin (mg/dL)", subset = PARAMCD == "BILI" ) |> metalite::define_analysis( name = "boxly", label = "Interactive Box Plot", x = "AVISITN", y = "CHG" ) |> metalite::meta_build() prepare_boxly(meta)