From 9d8c3c920c0c6d7f02b4fd61d9c66f29788f8efc Mon Sep 17 00:00:00 2001 From: elimillera Date: Mon, 20 Sep 2021 21:39:15 +0000 Subject: [PATCH 01/41] Update for passing build --- .Rbuildignore | 2 ++ DESCRIPTION | 5 ++++- NAMESPACE | 4 ++-- R/_disable_autoload.R | 3 +++ R/app_config.R | 45 +++++++++++++++++++++++++++++++++++++++++++ R/safetyGraphicsApp.R | 6 +++++- app.R | 7 +++++++ inst/golem-config.yml | 8 ++++++++ 8 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 R/_disable_autoload.R create mode 100644 R/app_config.R create mode 100644 app.R create mode 100644 inst/golem-config.yml diff --git a/.Rbuildignore b/.Rbuildignore index ab2f169e..9bb8f9e8 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -14,3 +14,5 @@ ^CRAN-RELEASE$ ^customSettings$ ^\.github$ +^app\.R$ +^rsconnect$ diff --git a/DESCRIPTION b/DESCRIPTION index 934c89c8..7b924260 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,7 +52,10 @@ Imports: sortable, stringr, yaml, - shinybusy + shinybusy, + pkgload, + golem, + config Remotes: safetyGraphics/safetyCharts VignetteBuilder: knitr Roxygen: list(markdown = TRUE) diff --git a/NAMESPACE b/NAMESPACE index 432ddc30..c380f8ce 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -52,6 +52,8 @@ import(safetyData) import(shiny) import(yaml) importFrom(DT,renderDT) +importFrom(config,get) +importFrom(golem,with_golem_options) importFrom(listviewer,jsonedit) importFrom(listviewer,jsoneditOutput) importFrom(listviewer,renderJsonedit) @@ -84,5 +86,3 @@ importFrom(stringr,str_to_upper) importFrom(utils,hasName) importFrom(utils,zip) importFrom(yaml,as.yaml) -importFrom(yaml,write_yaml) - diff --git a/R/_disable_autoload.R b/R/_disable_autoload.R new file mode 100644 index 00000000..a8c9436a --- /dev/null +++ b/R/_disable_autoload.R @@ -0,0 +1,3 @@ +# Disabling shiny autoload + +# See ?shiny::loadSupport for more information diff --git a/R/app_config.R b/R/app_config.R new file mode 100644 index 00000000..d19521cc --- /dev/null +++ b/R/app_config.R @@ -0,0 +1,45 @@ +#' Access files in the current app +#' +#' NOTE: If you manually change your package name in the DESCRIPTION, +#' don't forget to change it here too, and in the config file. +#' For a safer name change mechanism, use the `golem::set_golem_name()` function. +#' +#' @param ... character vectors, specifying subdirectory and file(s) +#' within your package. The default, none, returns the root of the app. +#' +#' @importFrom config get +#' +#' @noRd +app_sys <- function(...){ + system.file(..., package = "safetyGraphics") +} + + +#' Read App Config +#' +#' @param value Value to retrieve from the config file. +#' @param config GOLEM_CONFIG_ACTIVE value. If unset, R_CONFIG_ACTIVE. +#' If unset, "default". +#' @param use_parent Logical, scan the parent directory for config file. +#' +#' @noRd +get_golem_config <- function( + value, + config = Sys.getenv( + "GOLEM_CONFIG_ACTIVE", + Sys.getenv( + "R_CONFIG_ACTIVE", + "default" + ) + ), + use_parent = TRUE +){ + config::get( + value = value, + config = config, + # Modify this if your config file is somewhere else: + file = app_sys("golem-config.yml"), + use_parent = use_parent + ) +} + diff --git a/R/safetyGraphicsApp.R b/R/safetyGraphicsApp.R index 8902c97a..c19c4a7e 100644 --- a/R/safetyGraphicsApp.R +++ b/R/safetyGraphicsApp.R @@ -10,6 +10,7 @@ #' #' @import shiny #' @import safetyData +#' @importFrom golem with_golem_options #' #' @export @@ -43,5 +44,8 @@ safetyGraphicsApp <- function( ) } ) - runApp(app, launch.browser = TRUE) + with_golem_options( + app = app, golem_opts = NULL + ) + #runApp(app) } diff --git a/app.R b/app.R new file mode 100644 index 00000000..acf01d28 --- /dev/null +++ b/app.R @@ -0,0 +1,7 @@ +# Launch the ShinyApp (Do not remove this comment) +# To deploy, run: rsconnect::deployApp() +# Or use the blue button on top of this file +library(golem) +pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) +options( "golem.app.prod" = TRUE) +safetyGraphics::safetyGraphicsApp() # add parameters here (if any) diff --git a/inst/golem-config.yml b/inst/golem-config.yml new file mode 100644 index 00000000..0d9e06fc --- /dev/null +++ b/inst/golem-config.yml @@ -0,0 +1,8 @@ +default: + golem_name: safetyGraphics + golem_version: 2.0.0 + app_prod: no +production: + app_prod: yes +dev: + golem_wd: !expr here::here() From 2dcf258fc302229b5316a96c1f9e10f5bf4566f7 Mon Sep 17 00:00:00 2001 From: elimillera Date: Thu, 30 Sep 2021 13:58:15 +0000 Subject: [PATCH 02/41] Remove golem deps --- DESCRIPTION | 7 ++----- NAMESPACE | 2 -- R/app_config.R | 45 ---------------------------------------- R/safetyGraphicsApp.R | 13 ++++++------ app.R | 4 +--- inst/golem-config.yml | 8 ------- man/safetyGraphicsApp.Rd | 3 ++- 7 files changed, 12 insertions(+), 70 deletions(-) delete mode 100644 R/app_config.R delete mode 100644 inst/golem-config.yml diff --git a/DESCRIPTION b/DESCRIPTION index 7b924260..27ae0f84 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,7 +17,7 @@ Depends: R (>= 3.5) License: MIT + file LICENSE Encoding: UTF-8 LazyData: true -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2 Suggests: fs, ggplot2, @@ -52,10 +52,7 @@ Imports: sortable, stringr, yaml, - shinybusy, - pkgload, - golem, - config + shinybusy Remotes: safetyGraphics/safetyCharts VignetteBuilder: knitr Roxygen: list(markdown = TRUE) diff --git a/NAMESPACE b/NAMESPACE index c380f8ce..ba3befaa 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -52,8 +52,6 @@ import(safetyData) import(shiny) import(yaml) importFrom(DT,renderDT) -importFrom(config,get) -importFrom(golem,with_golem_options) importFrom(listviewer,jsonedit) importFrom(listviewer,jsoneditOutput) importFrom(listviewer,renderJsonedit) diff --git a/R/app_config.R b/R/app_config.R deleted file mode 100644 index d19521cc..00000000 --- a/R/app_config.R +++ /dev/null @@ -1,45 +0,0 @@ -#' Access files in the current app -#' -#' NOTE: If you manually change your package name in the DESCRIPTION, -#' don't forget to change it here too, and in the config file. -#' For a safer name change mechanism, use the `golem::set_golem_name()` function. -#' -#' @param ... character vectors, specifying subdirectory and file(s) -#' within your package. The default, none, returns the root of the app. -#' -#' @importFrom config get -#' -#' @noRd -app_sys <- function(...){ - system.file(..., package = "safetyGraphics") -} - - -#' Read App Config -#' -#' @param value Value to retrieve from the config file. -#' @param config GOLEM_CONFIG_ACTIVE value. If unset, R_CONFIG_ACTIVE. -#' If unset, "default". -#' @param use_parent Logical, scan the parent directory for config file. -#' -#' @noRd -get_golem_config <- function( - value, - config = Sys.getenv( - "GOLEM_CONFIG_ACTIVE", - Sys.getenv( - "R_CONFIG_ACTIVE", - "default" - ) - ), - use_parent = TRUE -){ - config::get( - value = value, - config = config, - # Modify this if your config file is somewhere else: - file = app_sys("golem-config.yml"), - use_parent = use_parent - ) -} - diff --git a/R/safetyGraphicsApp.R b/R/safetyGraphicsApp.R index c19c4a7e..fcc151c6 100644 --- a/R/safetyGraphicsApp.R +++ b/R/safetyGraphicsApp.R @@ -10,7 +10,6 @@ #' #' @import shiny #' @import safetyData -#' @importFrom golem with_golem_options #' #' @export @@ -25,7 +24,8 @@ safetyGraphicsApp <- function( mapping=NULL, autoMapping=TRUE, filterDomain="dm", - chartSettingsPaths = NULL + chartSettingsPaths = NULL, + run_now = TRUE ){ message("Initializing safetyGraphicsApp") config <- app_startup(domainData, meta, charts, mapping, autoMapping, filterDomain, chartSettingsPaths) @@ -44,8 +44,9 @@ safetyGraphicsApp <- function( ) } ) - with_golem_options( - app = app, golem_opts = NULL - ) - #runApp(app) + + if(run_now) + runApp(app) + else + app } diff --git a/app.R b/app.R index acf01d28..ed5fad1e 100644 --- a/app.R +++ b/app.R @@ -1,7 +1,5 @@ # Launch the ShinyApp (Do not remove this comment) # To deploy, run: rsconnect::deployApp() # Or use the blue button on top of this file -library(golem) pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) -options( "golem.app.prod" = TRUE) -safetyGraphics::safetyGraphicsApp() # add parameters here (if any) +safetyGraphics::safetyGraphicsApp(run_now = FALSE) # add parameters here (if any) diff --git a/inst/golem-config.yml b/inst/golem-config.yml deleted file mode 100644 index 0d9e06fc..00000000 --- a/inst/golem-config.yml +++ /dev/null @@ -1,8 +0,0 @@ -default: - golem_name: safetyGraphics - golem_version: 2.0.0 - app_prod: no -production: - app_prod: yes -dev: - golem_wd: !expr here::here() diff --git a/man/safetyGraphicsApp.Rd b/man/safetyGraphicsApp.Rd index 85610cb0..a3f5eed7 100644 --- a/man/safetyGraphicsApp.Rd +++ b/man/safetyGraphicsApp.Rd @@ -12,7 +12,8 @@ safetyGraphicsApp( mapping = NULL, autoMapping = TRUE, filterDomain = "dm", - chartSettingsPaths = NULL + chartSettingsPaths = NULL, + run_now = TRUE ) } \arguments{ From e3b0edb563910ca36741d4b1c638fb9ff8067f25 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Wed, 6 Oct 2021 16:44:09 -0400 Subject: [PATCH 03/41] remove whitespace in chart name. fix #636 --- DESCRIPTION | 2 +- NAMESPACE | 2 ++ R/prepareChart.R | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index db409f6a..f1ca0619 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: safetyGraphics Title: Interactive Graphics for Monitoring Clinical Trial Safety -Version: 2.0.0 +Version: 2.0.1 Authors@R: c( person("Jeremy", "Wildfire", email = "jwildfire@gmail.com", role = c("cre","aut")), person("Becca", "Krouse", role="aut"), diff --git a/NAMESPACE b/NAMESPACE index 6259b329..9ebe13f1 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -71,7 +71,9 @@ importFrom(shinyjs,show) importFrom(shinyjs,useShinyjs) importFrom(sortable,add_rank_list) importFrom(sortable,bucket_list) +importFrom(stringr,space) importFrom(stringr,str_detect) +importFrom(stringr,str_replace_all) importFrom(stringr,str_split) importFrom(stringr,str_to_title) importFrom(stringr,str_to_upper) diff --git a/R/prepareChart.R b/R/prepareChart.R index 7e795d9a..aefbc18d 100644 --- a/R/prepareChart.R +++ b/R/prepareChart.R @@ -5,6 +5,7 @@ #' @param chart chart object like the one generated by makeChartConfig(). #' #' @import purrr +#' @importFrom stringr str_replace_all space #' #' @return returns the chart object with a new functions object added. #' @@ -14,8 +15,11 @@ prepareChart <- function(chart){ #### Check required parameters #### # If no name is provided, use a placeholder and throw a message - if(!hasName(chart,"name")) chart$name <- "safetyGraphics Chart" + if(!hasName(chart,"name")) chart$name <- "safetyGraphicsChart" + # Remove whitespace (if any) from chart$name + chart$name<-stringr::str_replace_all(x, stringr::space(), "") + # Chart should be exportable by default if(!hasName(chart,"export")) chart$export <- TRUE From fdd24e2df8feebf5ed927656f69484886f614544 Mon Sep 17 00:00:00 2001 From: jwildfire Date: Wed, 6 Oct 2021 18:42:43 -0400 Subject: [PATCH 04/41] fix whitespace regex --- NAMESPACE | 1 - R/prepareChart.R | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 9ebe13f1..e8937fc7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -71,7 +71,6 @@ importFrom(shinyjs,show) importFrom(shinyjs,useShinyjs) importFrom(sortable,add_rank_list) importFrom(sortable,bucket_list) -importFrom(stringr,space) importFrom(stringr,str_detect) importFrom(stringr,str_replace_all) importFrom(stringr,str_split) diff --git a/R/prepareChart.R b/R/prepareChart.R index aefbc18d..7271ba7b 100644 --- a/R/prepareChart.R +++ b/R/prepareChart.R @@ -5,7 +5,7 @@ #' @param chart chart object like the one generated by makeChartConfig(). #' #' @import purrr -#' @importFrom stringr str_replace_all space +#' @importFrom stringr str_replace_all #' #' @return returns the chart object with a new functions object added. #' @@ -18,7 +18,7 @@ prepareChart <- function(chart){ if(!hasName(chart,"name")) chart$name <- "safetyGraphicsChart" # Remove whitespace (if any) from chart$name - chart$name<-stringr::str_replace_all(x, stringr::space(), "") + chart$name<-stringr::str_replace_all(x, "[[:space:]]", "") # Chart should be exportable by default if(!hasName(chart,"export")) chart$export <- TRUE From efed0ddaf9807e7c57d83fd6abb1aa280aed76a2 Mon Sep 17 00:00:00 2001 From: jwildfire Date: Wed, 6 Oct 2021 20:20:44 -0400 Subject: [PATCH 05/41] fix whitespace regex again --- R/prepareChart.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/prepareChart.R b/R/prepareChart.R index 7271ba7b..75410628 100644 --- a/R/prepareChart.R +++ b/R/prepareChart.R @@ -18,7 +18,7 @@ prepareChart <- function(chart){ if(!hasName(chart,"name")) chart$name <- "safetyGraphicsChart" # Remove whitespace (if any) from chart$name - chart$name<-stringr::str_replace_all(x, "[[:space:]]", "") + chart$name<-stringr::str_replace_all(chart$name, "[[:space:]]", "") # Chart should be exportable by default if(!hasName(chart,"export")) chart$export <- TRUE From 4965122545b2cde36145516c4fb521026b69a378 Mon Sep 17 00:00:00 2001 From: elimillera Date: Fri, 8 Oct 2021 00:33:07 +0000 Subject: [PATCH 06/41] update run_now to runNow --- R/safetyGraphicsApp.R | 7 ++++--- app.R | 2 +- man/safetyGraphicsApp.Rd | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/R/safetyGraphicsApp.R b/R/safetyGraphicsApp.R index fcc151c6..ed75fbd1 100644 --- a/R/safetyGraphicsApp.R +++ b/R/safetyGraphicsApp.R @@ -6,7 +6,8 @@ #' @param mapping list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')). #' @param autoMapping boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the `mapping` parameter overwrite automatically generated mappings when both are found. Defaults to true. #' @param filterDomain domain used for the data/filter tab. Demographics ("`dm`") is used by default. Using a domain that is not one record per participant is not recommended. -#' @param chartSettingsPaths path(s) where customization functions are saved relative to your working directory. All charts can have itialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details. +#' @param chartSettingsPaths path(s) where customization functions are saved relative to your working directory. All charts can have itialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details. +#' @param runNow Should the shiny app object created be run directly? Helpful when writing functions to dispatch to shinyapps, rsconnect, or shinyproxy. #' #' @import shiny #' @import safetyData @@ -25,7 +26,7 @@ safetyGraphicsApp <- function( autoMapping=TRUE, filterDomain="dm", chartSettingsPaths = NULL, - run_now = TRUE + runNow = TRUE ){ message("Initializing safetyGraphicsApp") config <- app_startup(domainData, meta, charts, mapping, autoMapping, filterDomain, chartSettingsPaths) @@ -45,7 +46,7 @@ safetyGraphicsApp <- function( } ) - if(run_now) + if(runNow) runApp(app) else app diff --git a/app.R b/app.R index ed5fad1e..5f177150 100644 --- a/app.R +++ b/app.R @@ -2,4 +2,4 @@ # To deploy, run: rsconnect::deployApp() # Or use the blue button on top of this file pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) -safetyGraphics::safetyGraphicsApp(run_now = FALSE) # add parameters here (if any) +safetyGraphics::safetyGraphicsApp(runNow = FALSE) # add parameters here (if any) diff --git a/man/safetyGraphicsApp.Rd b/man/safetyGraphicsApp.Rd index a3f5eed7..84f1e383 100644 --- a/man/safetyGraphicsApp.Rd +++ b/man/safetyGraphicsApp.Rd @@ -13,7 +13,7 @@ safetyGraphicsApp( autoMapping = TRUE, filterDomain = "dm", chartSettingsPaths = NULL, - run_now = TRUE + runNow = TRUE ) } \arguments{ @@ -30,6 +30,8 @@ safetyGraphicsApp( \item{filterDomain}{domain used for the data/filter tab. Demographics ("\code{dm}") is used by default. Using a domain that is not one record per participant is not recommended.} \item{chartSettingsPaths}{path(s) where customization functions are saved relative to your working directory. All charts can have itialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.} + +\item{runNow}{Should the shiny app object created be run directly? Helpful when writing functions to dispatch to shinyapps, rsconnect, or shinyproxy.} } \description{ Run the interactive safety graphics app From 1cf459e0dee79d5b5e1fc46d08f77ceb63578dd0 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Tue, 12 Oct 2021 21:50:00 -0400 Subject: [PATCH 07/41] update version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index f1ca0619..62404abc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: safetyGraphics Title: Interactive Graphics for Monitoring Clinical Trial Safety -Version: 2.0.1 +Version: 2.1.0 Authors@R: c( person("Jeremy", "Wildfire", email = "jwildfire@gmail.com", role = c("cre","aut")), person("Becca", "Krouse", role="aut"), From dc72dbc6381098bc700de93712ba8f0ba8c6a544 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Tue, 19 Oct 2021 12:49:22 -0400 Subject: [PATCH 08/41] Allow non-standard data in autoMapping. fix #642 --- R/makeMapping.R | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/R/makeMapping.R b/R/makeMapping.R index a1882d12..e84b0bf5 100644 --- a/R/makeMapping.R +++ b/R/makeMapping.R @@ -21,8 +21,13 @@ makeMapping <- function(domainData, meta, autoMapping, customMapping ){ }) names(standards)<-names(domainData) - auto_mapping_list <- standards %>% map(~.x$mapping) - auto_mapping_df<-bind_rows(auto_mapping_list, .id = "domain") %>% select(-.data$valid) + auto_mapping_list <- standards %>% map(function(standard){ + if(standard$standard=="none"){ + return(data.frame(domain=character(), text_key=character(), current=character(), valid=logical())) + }else{ + return(standard$mapping) + } + }) auto_mapping_df<-bind_rows(auto_mapping_list, .id = "domain") %>% select(-.data$valid) }else{ # otherwise initialize NULL standards/mapping standards<-NULL From 04a82bc0b9c93170196a3562ec54b14d1ea2e77b Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Wed, 20 Oct 2021 12:39:33 -0400 Subject: [PATCH 09/41] formatting fix --- R/makeMapping.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/makeMapping.R b/R/makeMapping.R index e84b0bf5..1ae554a3 100644 --- a/R/makeMapping.R +++ b/R/makeMapping.R @@ -27,7 +27,8 @@ makeMapping <- function(domainData, meta, autoMapping, customMapping ){ }else{ return(standard$mapping) } - }) auto_mapping_df<-bind_rows(auto_mapping_list, .id = "domain") %>% select(-.data$valid) + }) + auto_mapping_df<-bind_rows(auto_mapping_list, .id = "domain") %>% select(-.data$valid) }else{ # otherwise initialize NULL standards/mapping standards<-NULL From a7468f08e5446f99bd940d88507e68bb56d1c66c Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 4 Nov 2021 16:18:46 -0400 Subject: [PATCH 10/41] initial commit for makeMeta function --- NAMESPACE | 1 + R/app_startup.R | 7 ++++++- R/makeMeta.R | 43 +++++++++++++++++++++++++++++++++++++++++++ man/makeMeta.Rd | 31 +++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 R/makeMeta.R create mode 100644 man/makeMeta.Rd diff --git a/NAMESPACE b/NAMESPACE index e8937fc7..d86d9a7e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -21,6 +21,7 @@ export(makeChartExport) export(makeChartParams) export(makeChartSummary) export(makeMapping) +export(makeMeta) export(mappingColumn) export(mappingColumnUI) export(mappingDomain) diff --git a/R/app_startup.R b/R/app_startup.R index bf9f9d90..d2ff0ddd 100644 --- a/R/app_startup.R +++ b/R/app_startup.R @@ -22,7 +22,7 @@ #' #' @export app_startup<-function(domainData=NULL, meta=NULL, charts=NULL, mapping=NULL, autoMapping=NULL, filterDomain=NULL, chartSettingsPaths=NULL){ - # Process charts metadata + # If charts are not provided, load them from chartSettingsPath or the safetyCharts package if(is.null(charts)){ if(is.null(chartSettingsPaths)){ charts <- makeChartConfig() @@ -74,6 +74,11 @@ app_startup<-function(domainData=NULL, meta=NULL, charts=NULL, mapping=NULL, aut } } + # generate a meta object if none is provided + if(is.null(meta)){ + meta<-makeMeta(charts) + } + # generate mappings and data standards mappingObj <- makeMapping(domainData, meta, autoMapping, mapping) diff --git a/R/makeMeta.R b/R/makeMeta.R new file mode 100644 index 00000000..ab728630 --- /dev/null +++ b/R/makeMeta.R @@ -0,0 +1,43 @@ +#' Create a metadata object based on the selected charts +#' +#' @param charts list of charts for which metadata is needed +#' @param package package containing needed metadata +#' +#' @return tibble of metadata with the following columns: +#' \describe{ +#' \item{domain}{Data domain} +#' \item{text_key}{Text key indicating the setting name. \code{'--'} delimiter indicates a field level data mapping} +#' \item{col_key}{Key for the column mapping} +#' \item{field_key}{Key for the field mapping (if any)} +#' \item{type}{type of mapping - "field" or "column"} +#' \item{label}{Label} +#' \item{description}{Description} +#' \item{multiple}{Mapping supports multiple columns/fields } +#' \item{standard_adam}{Default values for the ADaM data standard} +#' \item{standard_sdtm}{Default values for the SDTM data standard} +#' } +#' +#' @export + +makeMeta <- function(charts, package="safetyCharts"){ + meta<-tibble() + # get a list of domains from the charts + domains <- charts %>% map(~.x$domains) %>% unlist %>% unique() + packagePath <- paste0('package:',package) + + # Find matching metadata files in safetyCharts (or safetyData?) + for(domain in domains){ + domain_name <- paste0('meta_',domain) + domain_meta_found <- exists( + domain_name, + where=packagePath, + inherits=FALSE + ) + meta<-tibble() + if(domain_meta_found){ + meta<-rbind(meta, get(domain_name,pos=packagePath, inherits=FALSE)) + } + } + + return(meta) +} \ No newline at end of file diff --git a/man/makeMeta.Rd b/man/makeMeta.Rd new file mode 100644 index 00000000..8b71994a --- /dev/null +++ b/man/makeMeta.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/makeMeta.R +\name{makeMeta} +\alias{makeMeta} +\title{Create a metadata object based on the selected charts} +\usage{ +makeMeta(charts, package = "safetyCharts") +} +\arguments{ +\item{charts}{list of charts for which metadata is needed} + +\item{package}{package containing needed metadata} +} +\value{ +tibble of metadata with the following columns: +\describe{ +\item{domain}{Data domain} +\item{text_key}{Text key indicating the setting name. \code{'--'} delimiter indicates a field level data mapping} +\item{col_key}{Key for the column mapping} +\item{field_key}{Key for the field mapping (if any)} +\item{type}{type of mapping - "field" or "column"} +\item{label}{Label} +\item{description}{Description} +\item{multiple}{Mapping supports multiple columns/fields } +\item{standard_adam}{Default values for the ADaM data standard} +\item{standard_sdtm}{Default values for the SDTM data standard} +} +} +\description{ +Create a metadata object based on the selected charts +} From 94da5ffb07efecedd4e1b725c538da94ce666c92 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 4 Nov 2021 16:56:57 -0400 Subject: [PATCH 11/41] typo clean up --- R/makeMeta.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/makeMeta.R b/R/makeMeta.R index ab728630..03157c15 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -22,10 +22,11 @@ makeMeta <- function(charts, package="safetyCharts"){ meta<-tibble() # get a list of domains from the charts - domains <- charts %>% map(~.x$domains) %>% unlist %>% unique() + domains <- charts %>% map(~.x$domain) %>% unlist %>% unique() packagePath <- paste0('package:',package) # Find matching metadata files in safetyCharts (or safetyData?) + meta<-tibble() for(domain in domains){ domain_name <- paste0('meta_',domain) domain_meta_found <- exists( @@ -33,7 +34,6 @@ makeMeta <- function(charts, package="safetyCharts"){ where=packagePath, inherits=FALSE ) - meta<-tibble() if(domain_meta_found){ meta<-rbind(meta, get(domain_name,pos=packagePath, inherits=FALSE)) } From 1bf63a7b8752c18edbc3f36a120341298f46c268 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Tue, 9 Nov 2021 13:37:24 -0500 Subject: [PATCH 12/41] use system.file() to load css. #651 --- NAMESPACE | 1 + R/mod_safetyGraphicsUI.R | 12 ++++-------- man/safetyGraphicsApp.Rd | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index e8937fc7..0503b39e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -52,6 +52,7 @@ import(safetyData) import(shiny) import(yaml) importFrom(DT,renderDT) +importFrom(devtools,system.file) importFrom(purrr,keep) importFrom(purrr,map) importFrom(purrr,map2) diff --git a/R/mod_safetyGraphicsUI.R b/R/mod_safetyGraphicsUI.R index 02f5dc6e..386981f6 100644 --- a/R/mod_safetyGraphicsUI.R +++ b/R/mod_safetyGraphicsUI.R @@ -8,20 +8,16 @@ #' @param standards a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard. #' #' @importFrom shinyjs useShinyjs +#' @importFrom devtools system.file #' #' @export safetyGraphicsUI <- function(id, meta, domainData, mapping, standards){ #read css from pacakge ns<-NS(id) - app_css <- NULL - for(lib in .libPaths()){ - if(is.null(app_css)){ - css_path <- paste(lib,'safetyGraphics', 'www','index.css', sep="/") - if(file.exists(css_path)) app_css <- HTML(readLines(css_path)) - } - } - + css_path <- system.file("www","index.css", package = "safetyGraphics") + app_css <- HTML(readLines(css_path)) + #script to append population badge nav bar participant_badge<-tags$script( HTML( diff --git a/man/safetyGraphicsApp.Rd b/man/safetyGraphicsApp.Rd index 565bd468..20251721 100644 --- a/man/safetyGraphicsApp.Rd +++ b/man/safetyGraphicsApp.Rd @@ -32,7 +32,6 @@ safetyGraphicsApp( \item{chartSettingsPaths}{path(s) where customization functions are saved relative to your working directory. All charts can have initialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.} \item{runNow}{Should the shiny app object created be run directly? Helpful when writing functions to dispatch to shinyapps, rsconnect, or shinyproxy.} - } \description{ Run the core safetyGraphics App From 92f919a2a5f32108b37a2f8ac2786c40ad88ce1c Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Tue, 9 Nov 2021 13:55:36 -0500 Subject: [PATCH 13/41] update docs --- NAMESPACE | 1 - R/makeChartConfig.R | 19 ++++++++----------- R/mod_safetyGraphicsUI.R | 4 ++-- R/safetyGraphicsInit.R | 10 ++-------- 4 files changed, 12 insertions(+), 22 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 0503b39e..e8937fc7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -52,7 +52,6 @@ import(safetyData) import(shiny) import(yaml) importFrom(DT,renderDT) -importFrom(devtools,system.file) importFrom(purrr,keep) importFrom(purrr,map) importFrom(purrr,map2) diff --git a/R/makeChartConfig.R b/R/makeChartConfig.R index bba374a5..4f615b2c 100644 --- a/R/makeChartConfig.R +++ b/R/makeChartConfig.R @@ -34,17 +34,14 @@ makeChartConfig <- function(dirs, packages="safetyCharts", packageLocation="conf if(!is.null(packages)){ for(package in packages){ packageFound<-FALSE - for(lib in .libPaths()){ - - packageDir<-paste(lib,package,packageLocation, sep="/") - if(file.exists(packageDir)) { - loaded <- do.call(require,list(package)) - if(!loaded) do.call(library,list(package)) #Attach the library to the search list if it is installed - message("- Found the {",package,"} package and added ", packageDir," to list of chart locations.") - packageFound<-TRUE - dirs<-c(dirs, packageDir) - break - } + packageDir <- system.file(packageLocation, package = package) + if(file.exists(packageDir)) { + loaded <- do.call(require,list(package)) + if(!loaded) do.call(library,list(package)) #Attach the library to the search list if it is installed + message("- Found the {",package,"} package and added ", packageDir," to list of chart locations.") + packageFound<-TRUE + dirs<-c(dirs, packageDir) + break } if(!packageFound){ message("{",package, "} package not found or '",packageLocation,"' folder does not exist, please install package and confirm that specified folder is found.") diff --git a/R/mod_safetyGraphicsUI.R b/R/mod_safetyGraphicsUI.R index 386981f6..c810437f 100644 --- a/R/mod_safetyGraphicsUI.R +++ b/R/mod_safetyGraphicsUI.R @@ -8,13 +8,13 @@ #' @param standards a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard. #' #' @importFrom shinyjs useShinyjs -#' @importFrom devtools system.file #' #' @export safetyGraphicsUI <- function(id, meta, domainData, mapping, standards){ - #read css from pacakge ns<-NS(id) + + #read css from package css_path <- system.file("www","index.css", package = "safetyGraphics") app_css <- HTML(readLines(css_path)) diff --git a/R/safetyGraphicsInit.R b/R/safetyGraphicsInit.R index 7c136424..b5927804 100644 --- a/R/safetyGraphicsInit.R +++ b/R/safetyGraphicsInit.R @@ -21,14 +21,8 @@ safetyGraphicsInit <- function(charts=makeChartConfig(), delayTime=1000, maxFile } } - - app_css <- NULL - for(lib in .libPaths()){ - if(is.null(app_css)){ - css_path <- paste(lib,'safetyGraphics', 'www','index.css', sep="/") - if(file.exists(css_path)) app_css <- HTML(readLines(css_path)) - } - } + css_path <- system.file("www","index.css", package = "safetyGraphics") + app_css <- HTML(readLines(css_path)) ui<-fluidPage( useShinyjs(), From f730ff38459c74b83837be560566e3d1aa83aaef Mon Sep 17 00:00:00 2001 From: jwildfire Date: Thu, 18 Nov 2021 02:44:03 +0000 Subject: [PATCH 14/41] move app.r to /inst --- app.R => inst/deploy/app.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename app.R => inst/deploy/app.R (73%) diff --git a/app.R b/inst/deploy/app.R similarity index 73% rename from app.R rename to inst/deploy/app.R index 5f177150..7451bed1 100644 --- a/app.R +++ b/inst/deploy/app.R @@ -1,5 +1,5 @@ # Launch the ShinyApp (Do not remove this comment) # To deploy, run: rsconnect::deployApp() # Or use the blue button on top of this file -pkgload::load_all(export_all = FALSE,helpers = FALSE,attach_testthat = FALSE) +library(safetyGraphics) # or use devtools::install_github() to load dev version safetyGraphics::safetyGraphicsApp(runNow = FALSE) # add parameters here (if any) From f51e82c491226ae555d6b000ef186638e0527d52 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Fri, 19 Nov 2021 11:34:42 -0500 Subject: [PATCH 15/41] don't source files by default. fix #652 --- R/makeChartConfig.R | 2 +- man/makeChartConfig.Rd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/makeChartConfig.R b/R/makeChartConfig.R index bba374a5..bcb2bb53 100644 --- a/R/makeChartConfig.R +++ b/R/makeChartConfig.R @@ -27,7 +27,7 @@ #' } #' @export -makeChartConfig <- function(dirs, packages="safetyCharts", packageLocation="config", sourceFiles=TRUE){ +makeChartConfig <- function(dirs, packages="safetyCharts", packageLocation="config", sourceFiles=FALSE){ if(missing(dirs)) dirs<-NULL # add local package installation to dirs if specified in packages diff --git a/man/makeChartConfig.Rd b/man/makeChartConfig.Rd index 8a51f9d7..85b40f89 100644 --- a/man/makeChartConfig.Rd +++ b/man/makeChartConfig.Rd @@ -8,7 +8,7 @@ makeChartConfig( dirs, packages = "safetyCharts", packageLocation = "config", - sourceFiles = TRUE + sourceFiles = FALSE ) } \arguments{ From 334affb29a4c26f87f0b60ad46c74b13a140b2ed Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Mon, 22 Nov 2021 17:58:43 -0500 Subject: [PATCH 16/41] start refactor for chart level metadata --- R/app_startup.R | 20 +++---- R/makeMeta.R | 77 +++++++++++++++++++-------- R/prepareChart.R | 118 +++++++++++++++++++++-------------------- R/safetyGraphicsApp.R | 4 +- R/safetyGraphicsInit.R | 2 +- 5 files changed, 128 insertions(+), 93 deletions(-) diff --git a/R/app_startup.R b/R/app_startup.R index d2ff0ddd..b3038a8c 100644 --- a/R/app_startup.R +++ b/R/app_startup.R @@ -3,7 +3,7 @@ #' Prepare inputs for safetyGraphics app - run before app is initialized. #' #' @param domainData named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default -#' @param meta data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}. +#' @param meta data frame containing the metadata for use in the app. #' @param charts list of charts in the format produced by safetyGraphics::makeChartConfig() #' @param mapping list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')). #' @param autoMapping boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the `mapping` parameter overwrite automatically generated mappings when both are found. Defaults to true. @@ -31,13 +31,8 @@ app_startup<-function(domainData=NULL, meta=NULL, charts=NULL, mapping=NULL, aut } } - # Attempt to bind chart functions if none are provided - charts <- charts %>% map(function(chart){ - if(!hasName(chart,"functions")){ - chart <- prepareChart(chart) - } - return(chart) - }) + # Prepare charts - fill in defaults, build metadata, bind functions + charts <- charts %>% map(prepareChart) # Drop charts where order is negative orderDrops <- charts[purrr::map_lgl(charts, function(chart) chart$order < 0)] @@ -74,10 +69,11 @@ app_startup<-function(domainData=NULL, meta=NULL, charts=NULL, mapping=NULL, aut } } - # generate a meta object if none is provided - if(is.null(meta)){ - meta<-makeMeta(charts) - } + # generate a full list of metadata + meta <- charts %>% map(~.x$meta) %>% rbind %>% distinct + + # warning if there are duplicate rows in a domain + # TODO # generate mappings and data standards mappingObj <- makeMapping(domainData, meta, autoMapping, mapping) diff --git a/R/makeMeta.R b/R/makeMeta.R index 03157c15..845102c7 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -1,7 +1,6 @@ -#' Create a metadata object based on the selected charts +#' Create a metadata object table for a chart #' -#' @param charts list of charts for which metadata is needed -#' @param package package containing needed metadata +#' @param chart safetyGraphics chart object for which to create metadata #' #' @return tibble of metadata with the following columns: #' \describe{ @@ -19,25 +18,61 @@ #' #' @export -makeMeta <- function(charts, package="safetyCharts"){ - meta<-tibble() - # get a list of domains from the charts - domains <- charts %>% map(~.x$domain) %>% unlist %>% unique() - packagePath <- paste0('package:',package) +makeMeta <- function(chart){ + stopifnot(typeof(chart$domain) %in% c('list','character')) + if(hasName(chart, 'meta')){ + message(chart$name, " already has `meta` defined. Skipping makeMeta() processing.") + }else{ + packagePath <- paste0('package:',chart$package) + if(typeof(chart$domain) == "character"){ + domains <- chart$domain + }else if(typeof(chart$domain) == "list"){ + domains <- names(chart$domain) + } + # process metadata for all values of chart$domains + all_meta <- tibble() + for(domain in domains){ + # get chart level meta + domain_meta_found <- exists( + paste0("meta_",domain), + where=packagePath, + inherits=FALSE + ) + if(domain_meta_found) { + chart_meta <- get( + paste0("meta_",domain), + pos=packagePath, + inherits=FALSE + ) + }else{ + chart_meta <- tibble() + } - # Find matching metadata files in safetyCharts (or safetyData?) - meta<-tibble() - for(domain in domains){ - domain_name <- paste0('meta_',domain) - domain_meta_found <- exists( - domain_name, - where=packagePath, - inherits=FALSE - ) - if(domain_meta_found){ - meta<-rbind(meta, get(domain_name,pos=packagePath, inherits=FALSE)) - } + # get domains level meta + domain_meta_found <- exists( + paste0("meta_",domain), + where=packagePath, + inherits=FALSE + ) + if(domain_meta_found) { + domain_meta <- get( + paste0("meta_",domain), + pos=packagePath, + inherits=FALSE + ) + }else{ + domain_meta <- tibble() + } + dup_keys <- intersect(chart_meta$text_key, domain_meta$text_key) + this_meta<-rbind(chart_meta, domain_meta) + + if(any(duplicated(this_meta$text_key))){ + dups <- meta$text_key[duplicated(this_meta$text_key)] + message("Caution: Found ", length(dups) ," duplicate text_key(s) in the ",domain, " domain for the ",chart$name," chart: ", paste(dups,collapse=", ")) + } + all_meta <- rbind(all_meta, this_meta) + } } - return(meta) + return(all_meta) } \ No newline at end of file diff --git a/R/prepareChart.R b/R/prepareChart.R index 75410628..7724de1a 100644 --- a/R/prepareChart.R +++ b/R/prepareChart.R @@ -36,72 +36,76 @@ prepareChart <- function(chart){ FALSE, tolower(chart$env)=="safetygraphics" ) + #### Make Chart-level meta-data #### + chart$meta <- makeMeta(chart) #### Bind Workflow functions to chart object #### - - all_functions <- as.character(utils::lsf.str(".GlobalEnv")) - - if(utils::hasName(chart, "package")){ - package_functions <- as.character(utils::lsf.str(paste0("package:",chart$package))) - all_functions<-c(all_functions,package_functions) - } + if(!hasName(chart,"functions")){ - #search functions that include the charts name or the workflow function names - chart_function_names <- c() - for(query in c(chart$name, unlist(chart$workflow)) ){ - matches<-all_functions[str_detect(query, all_functions)] - chart_function_names <- c(chart_function_names, matches) - } + all_functions <- as.character(utils::lsf.str(".GlobalEnv")) + + if(utils::hasName(chart, "package")){ + package_functions <- as.character(utils::lsf.str(paste0("package:",chart$package))) + all_functions<-c(all_functions,package_functions) + } - chart$functions <- lapply(chart_function_names, match.fun) - names(chart$functions) <- chart_function_names + #search functions that include the charts name or the workflow function names + chart_function_names <- c() + for(query in c(chart$name, unlist(chart$workflow)) ){ + matches<-all_functions[str_detect(query, all_functions)] + chart_function_names <- c(chart_function_names, matches) + } + + chart$functions <- lapply(chart_function_names, match.fun) + names(chart$functions) <- chart_function_names - # Define UI function unless one is provided - if(chart$type=="plot"){ - chart$functions$ui<-plotOutput - chart$functions$server<-renderPlot - chart$functions$main<-chart$functions[[chart$workflow$main]] - }else if(chart$type=="html"){ - chart$functions$ui<-htmlOutput - chart$functions$server<-renderText - chart$functions$main<-chart$functions[[chart$workflow$main]] - }else if(chart$type=="table"){ - chart$functions$ui<-DT::dataTableOutput - chart$functions$server<-function(expr){ - DT::renderDataTable( - expr, - rownames = FALSE, - options = list( - pageLength = 20, - ordering = FALSE, - searching = FALSE + # Define UI function unless one is provided + if(chart$type=="plot"){ + chart$functions$ui<-plotOutput + chart$functions$server<-renderPlot + chart$functions$main<-chart$functions[[chart$workflow$main]] + }else if(chart$type=="html"){ + chart$functions$ui<-htmlOutput + chart$functions$server<-renderText + chart$functions$main<-chart$functions[[chart$workflow$main]] + }else if(chart$type=="table"){ + chart$functions$ui<-DT::dataTableOutput + chart$functions$server<-function(expr){ + DT::renderDataTable( + expr, + rownames = FALSE, + options = list( + pageLength = 20, + ordering = FALSE, + searching = FALSE + ) ) - ) - } - chart$functions$main<-chart$functions[[chart$workflow$main]] - }else if(chart$type=="htmlwidget"){ - # Helper functions for html widget render - widgetOutput <- function(outputId, width = "100%", height = "400px") { - htmlwidgets::shinyWidgetOutput(outputId, chart$workflow$widget, width, height, package=chart$package) - } + } + chart$functions$main<-chart$functions[[chart$workflow$main]] + }else if(chart$type=="htmlwidget"){ + # Helper functions for html widget render + widgetOutput <- function(outputId, width = "100%", height = "400px") { + htmlwidgets::shinyWidgetOutput(outputId, chart$workflow$widget, width, height, package=chart$package) + } - renderWidget <- function(expr, env = parent.frame(), quoted = FALSE) { - if (!quoted) { expr <- substitute(expr) } # force quoted - htmlwidgets::shinyRenderWidget(expr, widgetOutput, env, quoted = TRUE) + renderWidget <- function(expr, env = parent.frame(), quoted = FALSE) { + if (!quoted) { expr <- substitute(expr) } # force quoted + htmlwidgets::shinyRenderWidget(expr, widgetOutput, env, quoted = TRUE) + } + + chart$functions$ui<-widgetOutput + chart$functions$server<-renderWidget + chart$functions$main<-htmlwidgets::createWidget + chart$workflow$main <- "htmlwidgets::createWidget" + }else if(chart$type=="module"){ + chart$functions$ui<-chart$functions[[chart$workflow$ui]] + chart$functions$server<-callModule + chart$functions$main <- chart$functions[[chart$workflow$server]] } - chart$functions$ui<-widgetOutput - chart$functions$server<-renderWidget - chart$functions$main<-htmlwidgets::createWidget - chart$workflow$main <- "htmlwidgets::createWidget" - }else if(chart$type=="module"){ - chart$functions$ui<-chart$functions[[chart$workflow$ui]] - chart$functions$server<-callModule - chart$functions$main <- chart$functions[[chart$workflow$server]] + # Print a message summarizing + message<-paste0(chart$name,": Loaded ", length(chart$functions)," functions: ", paste(names(chart$functions),collapse=",")) + message(message) } - - # Print a message summarizing - message<-paste0(chart$name,": Loaded ", length(chart$functions)," functions: ", paste(names(chart$functions),collapse=",")) - return(chart) } \ No newline at end of file diff --git a/R/safetyGraphicsApp.R b/R/safetyGraphicsApp.R index 024e922c..cb664f64 100644 --- a/R/safetyGraphicsApp.R +++ b/R/safetyGraphicsApp.R @@ -1,7 +1,7 @@ #' Run the core safetyGraphics App #' #' @param domainData named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default -#' @param meta data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}. +#' @param meta data frame containing the metadata for use in the app. #' @param charts list of charts in the format produced by safetyGraphics::makeChartConfig() #' @param mapping list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')). #' @param autoMapping boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the `mapping` parameter overwrite automatically generated mappings when both are found. Defaults to true. @@ -19,7 +19,7 @@ safetyGraphicsApp <- function( aes=safetyData::adam_adae, dm=safetyData::adam_adsl ), - meta = safetyGraphics::meta, + meta = NULL, charts=NULL, mapping=NULL, autoMapping=TRUE, diff --git a/R/safetyGraphicsInit.R b/R/safetyGraphicsInit.R index 7c136424..fa6d7709 100644 --- a/R/safetyGraphicsInit.R +++ b/R/safetyGraphicsInit.R @@ -124,7 +124,7 @@ safetyGraphicsInit <- function(charts=makeChartConfig(), delayTime=1000, maxFile shinyjs::show(id="sg-app") config<- app_startup( domainData = domainData() %>% keep(~!is.null(.x)), - meta = safetyGraphics::meta, + meta = NULL, charts= charts(), #mapping=NULL, filterDomain="dm", From 1e29d32a48b56a8604c1e6cf3569d52df14c2a3e Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sat, 4 Dec 2021 08:22:16 -0500 Subject: [PATCH 17/41] more makeMeta updates --- R/makeMeta.R | 54 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/R/makeMeta.R b/R/makeMeta.R index 845102c7..2c3e8479 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -29,25 +29,26 @@ makeMeta <- function(chart){ }else if(typeof(chart$domain) == "list"){ domains <- names(chart$domain) } - # process metadata for all values of chart$domains - all_meta <- tibble() - for(domain in domains){ - # get chart level meta - domain_meta_found <- exists( - paste0("meta_",domain), - where=packagePath, + + # check for chart level metadata + chart_meta_found <- exists( + paste0("meta_",chart$name), + where=packagePath, + inherits=FALSE + ) + if(chart_meta_found) { + chart_meta <- get( + paste0("meta_",chart$name), + pos=packagePath, inherits=FALSE ) - if(domain_meta_found) { - chart_meta <- get( - paste0("meta_",domain), - pos=packagePath, - inherits=FALSE - ) - }else{ - chart_meta <- tibble() - } + }else{ + chart_meta <- tibble() + } + # check for domain-level metadata + domain_meta <- tibble() + for(domain in domains){ # get domains level meta domain_meta_found <- exists( paste0("meta_",domain), @@ -55,23 +56,22 @@ makeMeta <- function(chart){ inherits=FALSE ) if(domain_meta_found) { - domain_meta <- get( + this_meta <- get( paste0("meta_",domain), pos=packagePath, inherits=FALSE ) }else{ - domain_meta <- tibble() - } - dup_keys <- intersect(chart_meta$text_key, domain_meta$text_key) - this_meta<-rbind(chart_meta, domain_meta) - - if(any(duplicated(this_meta$text_key))){ - dups <- meta$text_key[duplicated(this_meta$text_key)] - message("Caution: Found ", length(dups) ," duplicate text_key(s) in the ",domain, " domain for the ",chart$name," chart: ", paste(dups,collapse=", ")) + this_meta <- tibble() } - all_meta <- rbind(all_meta, this_meta) - } + domain_meta <- rbind(domain_meta, this_meta) + } + + # Drop domain-level metadata found in charts + chart_ids <- paste0(chart_meta$domain,"-",chart_meta$text_key) + domain_meta <- domain_meta %>% + filter(!(paste0(domain_meta$domain,"-",domain_meta$text_key) %in% chart_ids)) + all_meta <- rbind(chart_meta, domain_meta) } return(all_meta) From 42e7c4cf851ff3a0ed196ecf2b2ab3098d25bd66 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sun, 5 Dec 2021 06:57:43 -0500 Subject: [PATCH 18/41] shell for unit tests --- tests/testthat/test_makeMeta.R | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/testthat/test_makeMeta.R diff --git a/tests/testthat/test_makeMeta.R b/tests/testthat/test_makeMeta.R new file mode 100644 index 00000000..158a2a15 --- /dev/null +++ b/tests/testthat/test_makeMeta.R @@ -0,0 +1,17 @@ +context("Tests for the makeMeta() function") +library(safetyGraphics) +library(safetyCharts) + +# User Requirements +# - Charts with exisitng meta objects are not modified. A message is printed. +# - Chart-level metadata (e.g. meta_AEexplorer) is loaded when found +# - If no metadata is found for a chart, a warning message is printed. +# - If a chart doesn't have name or domain property no metadata is added and a message is printed. +# - Domain-level metadata is loaded for a single domain when found +# - Domain-level metadata for multiple domains is loaded when found +# - Domain-level metadata is loaded as expected when chart.domain is a named list or a character vector +# - Chart-level takes precedence over domain-level metadata when both are found + +test_that("placeholder test",{ + expect_true(FALSE) +}) From c992a6c0e22c0b502a3caf27ebc56b0022d70307 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sun, 5 Dec 2021 07:18:00 -0500 Subject: [PATCH 19/41] test for charts with existing metadata --- R/makeMeta.R | 5 ++--- tests/testthat/test_makeMeta.R | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/R/makeMeta.R b/R/makeMeta.R index 2c3e8479..2cdf0dea 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -71,8 +71,7 @@ makeMeta <- function(chart){ chart_ids <- paste0(chart_meta$domain,"-",chart_meta$text_key) domain_meta <- domain_meta %>% filter(!(paste0(domain_meta$domain,"-",domain_meta$text_key) %in% chart_ids)) - all_meta <- rbind(chart_meta, domain_meta) + chart$meta <- rbind(chart_meta, domain_meta) } - - return(all_meta) + return(chart) } \ No newline at end of file diff --git a/tests/testthat/test_makeMeta.R b/tests/testthat/test_makeMeta.R index 158a2a15..7c80781b 100644 --- a/tests/testthat/test_makeMeta.R +++ b/tests/testthat/test_makeMeta.R @@ -3,7 +3,7 @@ library(safetyGraphics) library(safetyCharts) # User Requirements -# - Charts with exisitng meta objects are not modified. A message is printed. +# - # - Chart-level metadata (e.g. meta_AEexplorer) is loaded when found # - If no metadata is found for a chart, a warning message is printed. # - If a chart doesn't have name or domain property no metadata is added and a message is printed. @@ -12,6 +12,20 @@ library(safetyCharts) # - Domain-level metadata is loaded as expected when chart.domain is a named list or a character vector # - Chart-level takes precedence over domain-level metadata when both are found -test_that("placeholder test",{ - expect_true(FALSE) +testChart <-list( + env="safetyGraphics", + name="ageDist", + label="Age Distribution", + type="plot", + domain="dm", + workflow=list( + main="ageDist" + ) +) + +test_that("Charts with exisitng meta objects are not modified. A message is printed.",{ + metaChart <- testChart + metaChart$meta <- "JustAPlaceholder" + expect_message(makeMeta(chart=metaChart)) + expect_equal(metaChart$Meta, "JustAPlaceholder") }) From 70fd7d083a8bbaca61f96da1383137321529cdad Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sun, 5 Dec 2021 07:18:08 -0500 Subject: [PATCH 20/41] test for charts with existing metadata --- tests/testthat/test_makeMeta.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test_makeMeta.R b/tests/testthat/test_makeMeta.R index 7c80781b..871e02c3 100644 --- a/tests/testthat/test_makeMeta.R +++ b/tests/testthat/test_makeMeta.R @@ -27,5 +27,5 @@ test_that("Charts with exisitng meta objects are not modified. A message is prin metaChart <- testChart metaChart$meta <- "JustAPlaceholder" expect_message(makeMeta(chart=metaChart)) - expect_equal(metaChart$Meta, "JustAPlaceholder") + expect_equal(metaChart$meta, "JustAPlaceholder") }) From 643483ca999e65fea29969e2472699bceeb36ae9 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Mon, 6 Dec 2021 22:41:07 -0500 Subject: [PATCH 21/41] add tests for domain metadata import --- R/makeMeta.R | 25 +++++++++++++++++-------- tests/testthat/test_makeMeta.R | 33 +++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/R/makeMeta.R b/R/makeMeta.R index 2cdf0dea..5841aba0 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -22,6 +22,7 @@ makeMeta <- function(chart){ stopifnot(typeof(chart$domain) %in% c('list','character')) if(hasName(chart, 'meta')){ message(chart$name, " already has `meta` defined. Skipping makeMeta() processing.") + all_meta <- NULL }else{ packagePath <- paste0('package:',chart$package) if(typeof(chart$domain) == "character"){ @@ -41,7 +42,8 @@ makeMeta <- function(chart){ paste0("meta_",chart$name), pos=packagePath, inherits=FALSE - ) + )%>% + mutate(source = paste0(packagePath, ":meta_", chart$name)) }else{ chart_meta <- tibble() } @@ -60,18 +62,25 @@ makeMeta <- function(chart){ paste0("meta_",domain), pos=packagePath, inherits=FALSE - ) + ) %>% + mutate(source = paste0(packagePath, ":meta_", domain)) }else{ this_meta <- tibble() } domain_meta <- rbind(domain_meta, this_meta) } - # Drop domain-level metadata found in charts - chart_ids <- paste0(chart_meta$domain,"-",chart_meta$text_key) - domain_meta <- domain_meta %>% - filter(!(paste0(domain_meta$domain,"-",domain_meta$text_key) %in% chart_ids)) - chart$meta <- rbind(chart_meta, domain_meta) + + all_meta <- rbind(chart_meta, domain_meta) + + # Remove duplicate meta data + dupes <- duplicated(all_meta%>%select(domain, text_key)) + if(any(dupes)){ + dup_meta <- all_meta[dupes,] + message("Removed ",sum(dupes)," duplicate metadata records for ", chart$name,".") + all_meta <- all_meta[!dupes,] + } } - return(chart) + + return(all_meta) } \ No newline at end of file diff --git a/tests/testthat/test_makeMeta.R b/tests/testthat/test_makeMeta.R index 871e02c3..08cb8ede 100644 --- a/tests/testthat/test_makeMeta.R +++ b/tests/testthat/test_makeMeta.R @@ -3,14 +3,14 @@ library(safetyGraphics) library(safetyCharts) # User Requirements -# - -# - Chart-level metadata (e.g. meta_AEexplorer) is loaded when found -# - If no metadata is found for a chart, a warning message is printed. -# - If a chart doesn't have name or domain property no metadata is added and a message is printed. -# - Domain-level metadata is loaded for a single domain when found -# - Domain-level metadata for multiple domains is loaded when found -# - Domain-level metadata is loaded as expected when chart.domain is a named list or a character vector -# - Chart-level takes precedence over domain-level metadata when both are found +# [*] Charts with exisiting meta objects are not modified. A message is printed. +# [ ] Chart-level metadata (e.g. meta_AEexplorer) is loaded when found +# [ ] If no metadata is found for a chart, a warning message is printed. +# [ ] If a chart doesn't have name or domain property no metadata is added and a message is printed. +# [*] Domain-level metadata is loaded for a single domain when found +# [*] Domain-level metadata for multiple domains is loaded when found +# [ ] Domain-level metadata is loaded as expected when chart domain is a named list or a character vector +# [ ] Chart-level takes precedence over domain-level metadata when both are found testChart <-list( env="safetyGraphics", @@ -18,14 +18,27 @@ testChart <-list( label="Age Distribution", type="plot", domain="dm", + package="safetyCharts" workflow=list( main="ageDist" ) ) -test_that("Charts with exisitng meta objects are not modified. A message is printed.",{ +test_that("Charts with exisiting meta objects are not modified. A message is printed.",{ metaChart <- testChart metaChart$meta <- "JustAPlaceholder" expect_message(makeMeta(chart=metaChart)) - expect_equal(metaChart$meta, "JustAPlaceholder") + expect_null(makeMeta(chart=metaChart)) +}) + +test_that("Domain-level metadata is loaded for a single domain when found.",{ + testMeta <- makeMeta(testChart) %>% select(-source) + expect_equal(testMeta, safetyCharts::meta_dm) +}) + +test_that("Domain-level metadata for multiple domains is loaded when found",{ + multiDomainChart <- testChart + multiDomainChart$domain <- c("dm","aes") + multiDomainMeta <- makeMeta(multiDomainChart) %>% select(-source) + expect_equal(multiDomainMeta, rbind(safetyCharts::meta_dm, safetyCharts::meta_aes)) }) From 1b057ec139df3d5ef9b661b30c49d9a9a9bfb825 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 9 Dec 2021 22:07:05 -0500 Subject: [PATCH 22/41] test for chart-level metadata --- tests/testthat/test_makeMeta.R | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test_makeMeta.R b/tests/testthat/test_makeMeta.R index 08cb8ede..b4eb2d6f 100644 --- a/tests/testthat/test_makeMeta.R +++ b/tests/testthat/test_makeMeta.R @@ -4,7 +4,7 @@ library(safetyCharts) # User Requirements # [*] Charts with exisiting meta objects are not modified. A message is printed. -# [ ] Chart-level metadata (e.g. meta_AEexplorer) is loaded when found +# [*] Chart-level metadata (e.g. meta_hepExplorer) is loaded when found # [ ] If no metadata is found for a chart, a warning message is printed. # [ ] If a chart doesn't have name or domain property no metadata is added and a message is printed. # [*] Domain-level metadata is loaded for a single domain when found @@ -18,7 +18,7 @@ testChart <-list( label="Age Distribution", type="plot", domain="dm", - package="safetyCharts" + package="safetyCharts", workflow=list( main="ageDist" ) @@ -42,3 +42,20 @@ test_that("Domain-level metadata for multiple domains is loaded when found",{ multiDomainMeta <- makeMeta(multiDomainChart) %>% select(-source) expect_equal(multiDomainMeta, rbind(safetyCharts::meta_dm, safetyCharts::meta_aes)) }) + +test_that("Chart-level metadata (e.g. meta_hepExplorer) is loaded when found",{ + testChart <-list( + env="safetyGraphics", + name="hepExplorer", + package="safetyCharts", + domain="none" + ) + chartMeta <- makeMeta(testChart) %>% select(-source) + expect_equal(chartMeta, safetyCharts::meta_hepExplorer) + + #Chart that chart-level and domain-level metadata stack + testChart$domain="labs" + chartMeta <- makeMeta(testChart) %>% select(-source) + expect_equal(chartMeta, rbind(safetyCharts::meta_hepExplorer, safetyCharts::meta_labs)) +}) + From d6fc9ac958f550faec62cf5f0ab3138d5e249cdb Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Fri, 25 Feb 2022 07:02:33 -0500 Subject: [PATCH 23/41] refactor makeMeta to work across all charts. #637 --- .Rbuildignore | 2 + R/app_startup.R | 9 ++-- R/makeMeta.R | 98 ++++++++++++++-------------------- R/prepareChart.R | 2 - R/safetyGraphicsApp.R | 2 +- man/app_startup.Rd | 2 +- man/makeMeta.Rd | 10 ++-- man/safetyGraphicsApp.Rd | 4 +- tests/testthat/test_makeMeta.R | 38 ++++++------- 9 files changed, 72 insertions(+), 95 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 893b8fef..8ef7fc5d 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -15,3 +15,5 @@ ^customSettings$ ^\.github$ ^LICENSE\.md$ +^rsconnect$ + diff --git a/R/app_startup.R b/R/app_startup.R index b3038a8c..0f23cc26 100644 --- a/R/app_startup.R +++ b/R/app_startup.R @@ -3,7 +3,7 @@ #' Prepare inputs for safetyGraphics app - run before app is initialized. #' #' @param domainData named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default -#' @param meta data frame containing the metadata for use in the app. +#' @param meta data frame containing the metadata for use in the app. If no metadata is provided (default value is NULL), metatdata is generated by `makeMeta()`. #' @param charts list of charts in the format produced by safetyGraphics::makeChartConfig() #' @param mapping list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')). #' @param autoMapping boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the `mapping` parameter overwrite automatically generated mappings when both are found. Defaults to true. @@ -69,11 +69,8 @@ app_startup<-function(domainData=NULL, meta=NULL, charts=NULL, mapping=NULL, aut } } - # generate a full list of metadata - meta <- charts %>% map(~.x$meta) %>% rbind %>% distinct - - # warning if there are duplicate rows in a domain - # TODO + # generate a full list of metadata if none is provided + if(is.null(meta)) meta <- makeMeta(charts) # generate mappings and data standards mappingObj <- makeMapping(domainData, meta, autoMapping, mapping) diff --git a/R/makeMeta.R b/R/makeMeta.R index 5841aba0..54bf0d18 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -1,6 +1,8 @@ -#' Create a metadata object table for a chart +#' Create a metadata object table for a set of charts #' -#' @param chart safetyGraphics chart object for which to create metadata +#' Generates metadata object for a list charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. +#' +#' @param charts list of safetyGraphics chart objects for which to create metadata #' #' @return tibble of metadata with the following columns: #' \describe{ @@ -18,69 +20,49 @@ #' #' @export -makeMeta <- function(chart){ - stopifnot(typeof(chart$domain) %in% c('list','character')) - if(hasName(chart, 'meta')){ - message(chart$name, " already has `meta` defined. Skipping makeMeta() processing.") - all_meta <- NULL - }else{ - packagePath <- paste0('package:',chart$package) - if(typeof(chart$domain) == "character"){ - domains <- chart$domain - }else if(typeof(chart$domain) == "list"){ - domains <- names(chart$domain) - } - - # check for chart level metadata - chart_meta_found <- exists( - paste0("meta_",chart$name), +makeMeta <- function(charts){ + sources <- charts %>% map(function(chart){ + pkg<-ifelse(is.null(chart$package), 'safetyCharts',chart$package) + files<-paste0('meta_',c(chart$name, chart$domain)) %>% map(~list(file=.x, pkg=pkg)) + return(files) + }) %>% + flatten %>% + unique + + dfs<-sources %>% map(function(src){ + packagePath <- paste0('package:',src$pkg) + file_found <- exists( + src$file, where=packagePath, inherits=FALSE ) - if(chart_meta_found) { - chart_meta <- get( - paste0("meta_",chart$name), + if(file_found){ + this_meta <- get( + src$file, pos=packagePath, inherits=FALSE - )%>% - mutate(source = paste0(packagePath, ":meta_", chart$name)) - }else{ - chart_meta <- tibble() - } - - # check for domain-level metadata - domain_meta <- tibble() - for(domain in domains){ - # get domains level meta - domain_meta_found <- exists( - paste0("meta_",domain), - where=packagePath, - inherits=FALSE ) - if(domain_meta_found) { - this_meta <- get( - paste0("meta_",domain), - pos=packagePath, - inherits=FALSE - ) %>% - mutate(source = paste0(packagePath, ":meta_", domain)) - }else{ - this_meta <- tibble() - } - domain_meta <- rbind(domain_meta, this_meta) + + if(is.data.frame(this_meta)){ + this_meta <- this_meta%>% + mutate(source = paste0(src$pkg, ":",src$file)) + return(this_meta) + } } - + }) - all_meta <- rbind(chart_meta, domain_meta) + meta<-bind_rows(dfs) + + # Throw error if duplicate records are found + dupes <- duplicated(meta%>%select(.data$domain, .data$text_key)) + if(any(dupes)){ + dupeIDs <- meta[dupes]%>% + mutate(domain_text_key=paste(.data$domain,.data$text_key,sep="-"))%>% + pull(.data$domain_text_key)%>% + paste(collapse="\n") + stop(paste("Duplicate rows in metadata for:\n",dupeIDs)) + } - # Remove duplicate meta data - dupes <- duplicated(all_meta%>%select(domain, text_key)) - if(any(dupes)){ - dup_meta <- all_meta[dupes,] - message("Removed ",sum(dupes)," duplicate metadata records for ", chart$name,".") - all_meta <- all_meta[!dupes,] - } - } + return(meta) +} - return(all_meta) -} \ No newline at end of file diff --git a/R/prepareChart.R b/R/prepareChart.R index 7724de1a..71ffebc4 100644 --- a/R/prepareChart.R +++ b/R/prepareChart.R @@ -36,8 +36,6 @@ prepareChart <- function(chart){ FALSE, tolower(chart$env)=="safetygraphics" ) - #### Make Chart-level meta-data #### - chart$meta <- makeMeta(chart) #### Bind Workflow functions to chart object #### if(!hasName(chart,"functions")){ diff --git a/R/safetyGraphicsApp.R b/R/safetyGraphicsApp.R index cb664f64..1d62348b 100644 --- a/R/safetyGraphicsApp.R +++ b/R/safetyGraphicsApp.R @@ -1,7 +1,7 @@ #' Run the core safetyGraphics App #' #' @param domainData named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default -#' @param meta data frame containing the metadata for use in the app. +#' @param meta data frame containing the metadata for use in the app. If no metadata is provided, metatdata is generated by `makeMeta()`. #' @param charts list of charts in the format produced by safetyGraphics::makeChartConfig() #' @param mapping list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')). #' @param autoMapping boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the `mapping` parameter overwrite automatically generated mappings when both are found. Defaults to true. diff --git a/man/app_startup.Rd b/man/app_startup.Rd index 4be6aed4..cccaa5ba 100644 --- a/man/app_startup.Rd +++ b/man/app_startup.Rd @@ -17,7 +17,7 @@ app_startup( \arguments{ \item{domainData}{named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default} -\item{meta}{data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}.} +\item{meta}{data frame containing the metadata for use in the app. If no metadata is provided (default value is NULL), metatdata is generated by \code{makeMeta()}.} \item{charts}{list of charts in the format produced by safetyGraphics::makeChartConfig()} diff --git a/man/makeMeta.Rd b/man/makeMeta.Rd index 8b71994a..c6301bcf 100644 --- a/man/makeMeta.Rd +++ b/man/makeMeta.Rd @@ -2,14 +2,12 @@ % Please edit documentation in R/makeMeta.R \name{makeMeta} \alias{makeMeta} -\title{Create a metadata object based on the selected charts} +\title{Create a metadata object table for a set of charts} \usage{ -makeMeta(charts, package = "safetyCharts") +makeMeta(charts) } \arguments{ -\item{charts}{list of charts for which metadata is needed} - -\item{package}{package containing needed metadata} +\item{charts}{list of safetyGraphics chart objects for which to create metadata} } \value{ tibble of metadata with the following columns: @@ -27,5 +25,5 @@ tibble of metadata with the following columns: } } \description{ -Create a metadata object based on the selected charts +Generates metadata object for a list charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. } diff --git a/man/safetyGraphicsApp.Rd b/man/safetyGraphicsApp.Rd index f5bf3615..3115379a 100644 --- a/man/safetyGraphicsApp.Rd +++ b/man/safetyGraphicsApp.Rd @@ -7,7 +7,7 @@ safetyGraphicsApp( domainData = list(labs = safetyData::adam_adlbc, aes = safetyData::adam_adae, dm = safetyData::adam_adsl), - meta = safetyGraphics::meta, + meta = NULL, charts = NULL, mapping = NULL, autoMapping = TRUE, @@ -18,7 +18,7 @@ safetyGraphicsApp( \arguments{ \item{domainData}{named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default} -\item{meta}{data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}.} +\item{meta}{data frame containing the metadata for use in the app. If no metadata is provided, metatdata is generated by \code{makeMeta()}.} \item{charts}{list of charts in the format produced by safetyGraphics::makeChartConfig()} diff --git a/tests/testthat/test_makeMeta.R b/tests/testthat/test_makeMeta.R index b4eb2d6f..46f8f5bb 100644 --- a/tests/testthat/test_makeMeta.R +++ b/tests/testthat/test_makeMeta.R @@ -3,14 +3,12 @@ library(safetyGraphics) library(safetyCharts) # User Requirements -# [*] Charts with exisiting meta objects are not modified. A message is printed. -# [*] Chart-level metadata (e.g. meta_hepExplorer) is loaded when found -# [ ] If no metadata is found for a chart, a warning message is printed. -# [ ] If a chart doesn't have name or domain property no metadata is added and a message is printed. -# [*] Domain-level metadata is loaded for a single domain when found -# [*] Domain-level metadata for multiple domains is loaded when found -# [ ] Domain-level metadata is loaded as expected when chart domain is a named list or a character vector -# [ ] Chart-level takes precedence over domain-level metadata when both are found +# [ ] Chart-level metadata (e.g. meta_hepExplorer) is loaded when found +# [ ] Domain-level metadata is loaded for a single domain when found +# [ ] Domain-level metadata for multiple domains is loaded when found +# [ ] If no metadata is found for a chart, a warning message is printed. +# [ ] An error is thrown if duplicate rows of metadata are found + testChart <-list( env="safetyGraphics", @@ -24,22 +22,15 @@ testChart <-list( ) ) -test_that("Charts with exisiting meta objects are not modified. A message is printed.",{ - metaChart <- testChart - metaChart$meta <- "JustAPlaceholder" - expect_message(makeMeta(chart=metaChart)) - expect_null(makeMeta(chart=metaChart)) -}) - test_that("Domain-level metadata is loaded for a single domain when found.",{ - testMeta <- makeMeta(testChart) %>% select(-source) + testMeta <- makeMeta(list(testChart)) %>% select(-source) expect_equal(testMeta, safetyCharts::meta_dm) }) test_that("Domain-level metadata for multiple domains is loaded when found",{ multiDomainChart <- testChart multiDomainChart$domain <- c("dm","aes") - multiDomainMeta <- makeMeta(multiDomainChart) %>% select(-source) + multiDomainMeta <- makeMeta(list(multiDomainChart)) %>% select(-source) expect_equal(multiDomainMeta, rbind(safetyCharts::meta_dm, safetyCharts::meta_aes)) }) @@ -50,12 +41,21 @@ test_that("Chart-level metadata (e.g. meta_hepExplorer) is loaded when found",{ package="safetyCharts", domain="none" ) - chartMeta <- makeMeta(testChart) %>% select(-source) + chartMeta <- makeMeta(list(testChart)) %>% select(-source) expect_equal(chartMeta, safetyCharts::meta_hepExplorer) #Chart that chart-level and domain-level metadata stack testChart$domain="labs" - chartMeta <- makeMeta(testChart) %>% select(-source) + chartMeta <- makeMeta(list(testChart)) %>% select(-source) expect_equal(chartMeta, rbind(safetyCharts::meta_hepExplorer, safetyCharts::meta_labs)) }) +test_that("metadata for multiple charts loads when found",{ + testCharts <-list( + list(name='chart1', domain=c('aes','dm'),package='safetyCharts'), + list(name='chart2', domain=c('labs','dm')) #package defaults to safetyCharts if not specified + ) + chartMeta <- makeMeta(testCharts) %>% select(-source) + expect_equal(chartMeta, rbind(safetyCharts::meta_aes, safetyCharts::meta_dm, safetyCharts::meta_labs)) +}) + From 8dd7adf9bff40cc2fbabadfe905097a47dce76bf Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Fri, 25 Feb 2022 10:41:32 -0500 Subject: [PATCH 24/41] add support for chart and more tests for makeMeta. #637 --- NAMESPACE | 1 + R/makeMeta.R | 62 ++++++++++++++++----- R/meta.R | 20 ------- data-raw/makeMeta.R | 7 --- data-raw/meta.csv | 31 ----------- data/meta.rda | Bin 1543 -> 0 bytes tests/testthat/test_makeMeta.R | 95 ++++++++++++++++++++++++++++++--- 7 files changed, 138 insertions(+), 78 deletions(-) delete mode 100644 R/meta.R delete mode 100644 data-raw/makeMeta.R delete mode 100644 data-raw/meta.csv delete mode 100644 data/meta.rda diff --git a/NAMESPACE b/NAMESPACE index d86d9a7e..da98f1a3 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -77,6 +77,7 @@ importFrom(stringr,str_replace_all) importFrom(stringr,str_split) importFrom(stringr,str_to_title) importFrom(stringr,str_to_upper) +importFrom(tidyr,replace_na) importFrom(utils,hasName) importFrom(utils,zip) importFrom(yaml,as.yaml) diff --git a/R/makeMeta.R b/R/makeMeta.R index 54bf0d18..501f9ef0 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -18,9 +18,12 @@ #' \item{standard_sdtm}{Default values for the SDTM data standard} #' } #' +#' @importFrom tidyr replace_na starts_with #' @export makeMeta <- function(charts){ + message(paste0("-Generating meta data for ",length(charts), " charts.")) + # Check each chart to see if {package}::meta_{domain} or {package}::meta_{name} exists sources <- charts %>% map(function(chart){ pkg<-ifelse(is.null(chart$package), 'safetyCharts',chart$package) files<-paste0('meta_',c(chart$name, chart$domain)) %>% map(~list(file=.x, pkg=pkg)) @@ -29,7 +32,7 @@ makeMeta <- function(charts){ flatten %>% unique - dfs<-sources %>% map(function(src){ + pkg_dfs<-sources %>% map(function(src){ packagePath <- paste0('package:',src$pkg) file_found <- exists( src$file, @@ -45,24 +48,55 @@ makeMeta <- function(charts){ if(is.data.frame(this_meta)){ this_meta <- this_meta%>% - mutate(source = paste0(src$pkg, ":",src$file)) + mutate(source = paste0(src$pkg, "::",src$file)) return(this_meta) } } }) - meta<-bind_rows(dfs) - - # Throw error if duplicate records are found - dupes <- duplicated(meta%>%select(.data$domain, .data$text_key)) - if(any(dupes)){ - dupeIDs <- meta[dupes]%>% - mutate(domain_text_key=paste(.data$domain,.data$text_key,sep="-"))%>% - pull(.data$domain_text_key)%>% - paste(collapse="\n") - stop(paste("Duplicate rows in metadata for:\n",dupeIDs)) - } + ## check for meta bound directly to the charts + chart_dfs <- charts %>% map(function(chart){ + if(is.data.frame(chart$meta)){ + this_meta <- chart$meta %>% mutate(source = paste0('charts$', chart$name, "$meta")) + return(this_meta) + }else{ + if(!is.null(chart$meta)) warning(paste0("Ignoring non-data.frame object found in charts$", chart$name, "$meta")) + } + }) - return(meta) + ## make sure dfs have required columns + dfs<-c(pkg_dfs,chart_dfs) + required_cols <- c("domain","text_key","col_key","type") + dfs <- dfs%>% + keep(is.data.frame)%>% + keep(function(df){ + has_cols <- all(required_cols %in% names(df)) + if(!has_cols) warning(paste(df[1,'source'],"dropped from meta because of missing required columns.")) + return(has_cols) + }) + + ## combine list of dfs into single df + if(length(dfs)>0){ + meta<-bind_rows(dfs) %>% + mutate_at(vars(tidyr::starts_with('standard_')), ~tidyr::replace_na(., "")) + + # Throw error if duplicate records are found + dupes <- duplicated(meta%>%select(.data$domain, .data$text_key)) + if(any(dupes)){ + dupeIDs <- meta[dupes,]%>% + mutate(domain_text_key=paste(.data$domain,.data$text_key,sep="-"))%>% + pull(.data$domain_text_key)%>% + unique%>% + paste(collapse="\n") + stop(paste("Duplicate rows in metadata for:\n",dupeIDs)) + } + + sources <- meta %>% pull(source) %>% unique %>% paste(collapse=" ") + message(paste0("-Meta object created using the following source(s): ",sources)) + return(meta) + } else { + stop("No metadata found. ") + } + } diff --git a/R/meta.R b/R/meta.R deleted file mode 100644 index 8df6856a..00000000 --- a/R/meta.R +++ /dev/null @@ -1,20 +0,0 @@ -#' Metadata data frame containing information about the data mapping used to configure safetyGraphics charts. One record per unique data mapping -#' -#' @format A data frame with 31 rows and 7 columns -#' \describe{ -#' \item{domain}{Data domain} -#' \item{text_key}{Text key indicating the setting name. \code{'--'} delimiter indicates a field level data mapping} -#' \item{col_key}{Key for the column mapping} -#' \item{field_key}{Key for the field mapping (if any)} -#' \item{type}{type of mapping - "field" or "column"} -#' \item{label}{Label} -#' \item{description}{Description} -#' \item{multiple}{Mapping supports multiple columns/fields } -#' \item{standard_adam}{Default values for the ADaM data standard} -#' \item{standard_sdtm}{Default values for the SDTM data standard} -#' } -#' -#' @source Created for this package - - -"meta" diff --git a/data-raw/makeMeta.R b/data-raw/makeMeta.R deleted file mode 100644 index ff61458f..00000000 --- a/data-raw/makeMeta.R +++ /dev/null @@ -1,7 +0,0 @@ -# Note: expected to be run from the root package directory -library(tidyverse) -library(usethis) - -#Copy metadata to /data -meta<-read_csv("data-raw/meta.csv") -usethis::use_data(meta, overwrite = TRUE) diff --git a/data-raw/meta.csv b/data-raw/meta.csv deleted file mode 100644 index 4973a088..00000000 --- a/data-raw/meta.csv +++ /dev/null @@ -1,31 +0,0 @@ -text_key,domain,col_key,field_key,type,label,description,multiple,standard_adam,standard_sdtm -id_col,aes,id_col,,column,ID column,Unique subject identifier variable name.,FALSE,USUBJID,USUBJID -seq_col,aes,seq_col,,column,Sequence column,Event sequence number variable name,FALSE,AESEQ,AESEQ -stdy_col,aes,stdy_col,,column,AE Start day column,Event start day variable name,FALSE,ASTDY,AESTDY -endy_col,aes,endy_col,,column,AE End day column,Event end day variable name,FALSE,AENDY,AEENDY -term_col,aes,term_col,,column,Preferred Term Column,Dictionary-Derived Term,FALSE,AEDECOD,AEDECOD -bodsys_col,aes,bodsys_col,,column,AE Body System,Body System or Organ Class,FALSE,AEBODSYS,AEBODSYS -id_col,labs,id_col,,column,ID column,Unique subject identifier variable name.,FALSE,USUBJID,USUBJID -value_col,labs,value_col,,column,Value column,Lab result variable name.,FALSE,AVAL,LBSTRESN -measure_col,labs,measure_col,,column,Measure column,Lab measure variable name,FALSE,PARAM,LBTEST -normal_col_low,labs,normal_col_low,,column,Lower Limit of Normal column,Lower limit of normal variable name,FALSE,A1LO,LBSTNRLO -normal_col_high,labs,normal_col_high,,column,Upper Limit of Normal column,Upper limit of normal variable name,FALSE,A1HI,LBSTNRHI -studyday_col,labs,studyday_col,,column,Study Day column,Visit day variable name,FALSE,ADY,LBDY -visit_col,labs,visit_col,,column,Visit column,Visit variable name,FALSE,VISIT,VISIT -visitn_col,labs,visitn_col,,column,Visit Number column,Visit number variable name,FALSE,VISITNUM,VISITNUM -measure_values--ALT,labs,measure_col,ALT,field,Alanine Aminotransferase value,Value used for Alanine Aminotransferase in the specified measure column,FALSE,Alanine Aminotransferase (U/L),Alanine Aminotransferase -measure_values--AST,labs,measure_col,AST,field,Aspartate Aminotransferase value,Value used for Aspartate Aminotransferase in the specified measure column,FALSE,Aspartate Aminotransferase (U/L),Aspartate Aminotransferase -measure_values--TB,labs,measure_col,TB,field,Total Bilirubin value,Value used for Total Bilirubin in the specified measure column,FALSE,Bilirubin (umol/L),Bilirubin -measure_values--ALP,labs,measure_col,ALP,field,Alkaline Phosphatase value,Value used for Alkaline Phosphatase in the specified measure column,FALSE,Alkaline Phosphatase (U/L),Alkaline Phosphatase -unit_col,labs,unit_col,,column,Unit column,Unit of measure variable name,FALSE,,LBSTRESU -baseline_flag_col,labs,baseline_flag_col,,column,Baseline column,An optional list defining which column represent the baseline visit(s) of the study.,FALSE,, -baseline_flag_values,labs,baseline_flag_col,values,field,Baseline values,An optional list defining which values (one or more) represent the baseline visit(s) of the study.,TRUE,, -analysis_flag_col,labs,analysis_flag_col,,column,Analysis column,An optional list defining which column represent the analysis visit(s) of the study.,FALSE,, -analysis_flag_values,labs,analysis_flag_col,values,field,Analysis values,An optional list defining which values (one or more) represent the analysis visit(s) of the study.,TRUE,, -id_col,dm,id_col,,column,ID column,Unique subject identifier variable name.,FALSE,USUBJID,USUBJID -treatment_col,dm,treatment_col,,column,Treatment Column,Treatment Column,FALSE,ARM,ARM -treatment_values--group1,dm,treatment_col,group1,field,Treatment 1,Treatment 1,FALSE,, -treatment_values--group2,dm,treatment_col,group2,field,Treatment 2,Treatment 2,FALSE,, -sex_col,dm,sex_col,,column,Sex Column,Sex Column,FALSE,SEX,SEX -race_col,dm,race_col,,column,Race Column,Race Column,FALSE,RACE,RACE -age_col,dm,age_col,,column,Age Column,Age Column,FALSE,AGE,AGE diff --git a/data/meta.rda b/data/meta.rda deleted file mode 100644 index 8be670d4be3484a8f809777de96f5e89be718985..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1543 zcmV+i2Kf0xT4*^jL0KkKS*0Lt!vF^9|H1$N{{Kj0umL{z|6srW|KLCX5C8xH;0FH+ zIx5U400000N-3eJnrLWkMoiHF9-zp`226*k>ODq-Y5*K$!89@%85uM*0iejj0ie;Q zLlDpbrirAc$uu$m4FCYhX{L<;1|gst0me)dLm`oolS4on42&Qe4H{%I4FEXFf@owi zGBRjr13{6513{xqh9RH%I&LSp{}z`hNc2f7c`uN4qzo;U(Qg>D1$DdZ0T$s~yJ;rvmqQ>TXhmQBPdx3#{)nCw`&6k|PpdRtcJJXz!i1;|o^jz`X2Y+slSmLkR$bjQGglQ+2<-SWI1@s{PsJc z6+q!N$j4nrOEpA@aR=UyuOZImv^>!AIQTw{mj4W&qx4`k`I#3pTGpk^pNF&AgJ0E` z+V>|E@0t8aR~JKPO6WK%1(w9q?^6ioBfMkCuW!v$kd_KGS~U3zP5 z&?`cTOpxqAz+rl9z3KG6=kT)(7Jckj&$gCevn;uNmi4A~3aYIaGB8?2}BoN#9f&XEmGDvC9k39gv)=c>Qub5c2T)JxLr% z9Zm_V6p_p;Vutq$Ub6-U+_Bc%V=Vd`pXN-ABN=7maQQYoWlM zW+js}&RqEGG&Os4+SX~F0i)HCb=uloiDGJMEm!Q;*3Uj9%I(9wfURd(>snlU!$JFU zoFmGnMvjk7R&IwxPGfO7j2_dHNt2|`oHLpY26=EKTs{PYtB?L$GCB4%~D1ihtc3s9ydmW<2G*^?xb z-{aW&D*~CJl~OJ!`r}J8<$cTsBP@}Fk09ah7tHT2j&~6)9CIQBpb`$Z>8MLgPf3sT&gn)#Bc2 zD=d?do@X8-$8!YMT5#7rMFlt2)LwTBCiTUh22|NexS@IEY^Q8y8KQM{8ZGeUHySi$ zI}ABm7Cj1>EehbZNuD@NHueIybf%Al^D$j!TtFN|Jv`%lmgP tGCZvDag0nS3Q(muoDE}*<^DYKN<`=-)`d`o+N2-+UC9*TLPC^*w+zvc-~9jp diff --git a/tests/testthat/test_makeMeta.R b/tests/testthat/test_makeMeta.R index 46f8f5bb..93aa8f1e 100644 --- a/tests/testthat/test_makeMeta.R +++ b/tests/testthat/test_makeMeta.R @@ -3,12 +3,17 @@ library(safetyGraphics) library(safetyCharts) # User Requirements -# [ ] Chart-level metadata (e.g. meta_hepExplorer) is loaded when found -# [ ] Domain-level metadata is loaded for a single domain when found -# [ ] Domain-level metadata for multiple domains is loaded when found -# [ ] If no metadata is found for a chart, a warning message is printed. -# [ ] An error is thrown if duplicate rows of metadata are found - +# [*] Chart-level metadata (e.g. meta_hepExplorer) is loaded when found +# [*] Domain-level metadata is loaded for a single domain when found +# [*] Domain-level metadata for multiple domains is loaded when found +# [*] Metadata is loaded as expected for multiple charts +# [*] Metadata saved to chart.meta is loaded +# [*] Metadata saved to chart.meta is loaded with chart-level and domain-level metadata. +# [*] Metadata that is not a dataframe is not loaded and a message is printed. +# [*] Metadata with incorrect columns is not loaded and a message is printed. +# [*] If no metadata is found for a chart, a warning message is printed. +# [*] An error is thrown if duplicate rows of metadata are found +# [*] An error is thrown if no metadata is found testChart <-list( env="safetyGraphics", @@ -59,3 +64,81 @@ test_that("metadata for multiple charts loads when found",{ expect_equal(chartMeta, rbind(safetyCharts::meta_aes, safetyCharts::meta_dm, safetyCharts::meta_labs)) }) +helloMeta <- tribble( + ~text_key, ~domain, ~label, ~description, + "x_col", "hello", "x position", "x position for points in hello world chart", + "y_col", "hello", "y position", "y position for points in hello world chart" +) %>% mutate( + col_key = text_key, + type="column" +) +helloChart <- list(name='hello',meta=helloMeta) + +test_that("metadata saved to chart.meta is loaded",{ + chartMeta <- makeMeta(list(helloChart)) %>% select(-source) + expect_equal(chartMeta,helloMeta) +}) + +test_that("Metadata saved to chart.meta is loaded with chart-level and domain-level metadata.",{ + hepChart <-list( + env="safetyGraphics", + name="hepExplorer", + package="safetyCharts", + domain="labs" + ) + charts<-list(helloChart,hepChart) + chartMeta <- makeMeta(charts) %>% select(-source) + expect_equal(chartMeta,bind_rows(safetyCharts::meta_hepExplorer, safetyCharts::meta_labs, helloMeta)) +}) + +test_that("chart.meta that is not a dataframe is not loaded and a message is printed.",{ + badHello <-list( + list(name='hello',meta="not-a-df"), + list(name="labChart",domain="labs") + ) + expect_warning(makeMeta(badHello)) + expect_equal(suppressWarnings(makeMeta(badHello))%>%select(-source), safetyCharts::meta_labs) +}) + +test_that("Metadata with incorrect columns is not loaded and a message is printed.",{ + badHello2 <- list( + list(name='hello',meta=helloMeta%>%rename(id=text_key)), + list(name="labChart",domain="labs") + ) + expect_warning(makeMeta(badHello2)) + expect_equal(suppressWarnings(makeMeta(badHello2))%>%select(-source), safetyCharts::meta_labs) +}) + +test_that("An error is thrown if duplicate rows of metadata are found",{ + dupLabMeta <- tribble( + ~text_key, ~domain, ~label, ~description, + "id_col", "labs", "ID", "ID" + ) %>% mutate( + col_key = text_key, + type="column" + ) + dupTest <- list( + list(name='myLabChart',meta=dupLabMeta), + list(name="thierLabChart",domain="labs") + ) + expect_error(makeMeta(dupTest)) + + helloDupMeta <- tribble( + ~text_key, ~domain, ~label, ~description, + "x_col", "hello", "x position", "x position for points in hello world chart", + "x_col", "hello", "x position (again)" , "x position for points in hello world chart" + ) %>% mutate( + col_key = text_key, + type="column" + ) + helloDup <- list(list(name='helloDup',meta=helloDupMeta)) + expect_error(makeMeta(helloDup)) +}) + +test_that("An error is thrown if no metadata is found",{ + noMetaTest <- list( + list(name='myLabChart',domain="slabs"), + list(name="thierLabChart",domain="crabs") + ) + expect_error(makeMeta(noMetaTest)) +}) \ No newline at end of file From 9e5b05018f8f7c032848983ac92e6a5a5cf19324 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Fri, 25 Feb 2022 13:00:18 -0500 Subject: [PATCH 25/41] fix test and check issues caused by meta migration --- DESCRIPTION | 1 + NAMESPACE | 1 + R/detectStandard.R | 8 ++-- R/evaluateStandard.R | 4 +- R/makeMapping.R | 2 +- R/makeMeta.R | 4 +- R/mod_safetyGraphicsServer.R | 2 +- R/mod_safetyGraphicsUI.R | 2 +- man/detectStandard.Rd | 8 ++-- man/evaluateStandard.Rd | 4 +- man/makeMapping.Rd | 2 +- man/meta.Rd | 31 ------------- man/safetyGraphicsServer.Rd | 2 +- man/safetyGraphicsUI.Rd | 2 +- .../testthat/module_examples/chartsTab/app.R | 10 +++- .../module_examples/mappingDomain/app.R | 28 ++++++----- .../module_examples/settingsMapping/app.R | 13 ++++-- tests/testthat/test_detectStandard.R | 46 +++++++++---------- tests/testthat/test_evaluateStandard.R | 34 +++++++------- tests/testthat/test_makeMapping.R | 21 ++++++--- tests/testthat/test_mod_mappingColumn.R | 7 +++ tests/testthat/test_mod_mappingDomain.R | 25 ++++++---- 22 files changed, 133 insertions(+), 124 deletions(-) delete mode 100644 man/meta.Rd diff --git a/DESCRIPTION b/DESCRIPTION index f1ca0619..cf0fa2fd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,6 +44,7 @@ Imports: shinyjs (>= 2.0.0), sortable (>= 0.4.4), stringr (>= 1.4.0), + tidyr, yaml (>= 2.2.1) VignetteBuilder: knitr Roxygen: list(markdown = TRUE) diff --git a/NAMESPACE b/NAMESPACE index da98f1a3..7542ed76 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -78,6 +78,7 @@ importFrom(stringr,str_split) importFrom(stringr,str_to_title) importFrom(stringr,str_to_upper) importFrom(tidyr,replace_na) +importFrom(tidyr,starts_with) importFrom(utils,hasName) importFrom(utils,zip) importFrom(yaml,as.yaml) diff --git a/R/detectStandard.R b/R/detectStandard.R index 0b6ab402..ea555b77 100644 --- a/R/detectStandard.R +++ b/R/detectStandard.R @@ -5,19 +5,19 @@ #' This function compares the columns in the provided \code{"data"} with the required columns for a given data standard/domain combination. The function is designed to work with the SDTM and ADaM CDISC() standards for clinical trial data by default. Additional standards can be added by modifying the \code{"meta"} data set included as part of this package. #' #' @param data A data frame in which to detect the data standard - required. -#' @param meta the metadata containing the data standards. - default = safetyGraphics::meta +#' @param meta the metadata containing the data standards. #' @param domain the domain to evaluate - should match a value of \code{meta$domain}. Uses the first value in \code{meta$domain} if no value is provided. #' #' @return A data frame describing the detected standard for each \code{"text_key"} in the provided metadata. Columns are \code{"domain"}, \code{"text_key"}, \code{"column"} and \code{"standard"}. #' @examples -#' detectStandard(data=safetyData::adam_adae) #aes domain evaluated by default -#' detectStandard(data=safetyData::adam_adlbc,domain="labs" ) +#' detectStandard(data=safetyData::adam_adae, meta=safetyCharts::meta_aes) +#' detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs, domain="labs" ) #' #' @importFrom stringr str_detect #' #' @export -detectStandard <- function(data, domain=NULL, meta=safetyGraphics::meta){ +detectStandard <- function(data, domain=NULL, meta=NULL){ if(is.null(domain)){ domain<-unique(meta$domain)[1] } diff --git a/R/evaluateStandard.R b/R/evaluateStandard.R index 282a0535..97679604 100644 --- a/R/evaluateStandard.R +++ b/R/evaluateStandard.R @@ -13,7 +13,7 @@ #' # Match is TRUE #' evaluateStandard( #' data=safetyData::adam_adlbc, -#' meta=meta, +#' meta=safetyCharts::meta_labs, #' domain="labs", #' standard="adam" #' ) @@ -21,7 +21,7 @@ #' # Match is FALSE #' evaluateStandard( #' data=safetyData::adam_adlbc, -#' meta=meta, +#' meta=safetyCharts::meta_labs, #' domain="labs", #' standard="sdtm" #' ) diff --git a/R/makeMapping.R b/R/makeMapping.R index 1ae554a3..c98f66a0 100644 --- a/R/makeMapping.R +++ b/R/makeMapping.R @@ -1,7 +1,7 @@ #' Create data mapping based on data standards and user input #' #' @param domainData named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default -#' @param meta data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}. +#' @param meta data frame containing the metadata for use in the app. #' @param customMapping optional list specifying initial mapping values within each data mapping (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')). #' @param autoMapping boolean indicating whether the app should use `safetyGraphics::detectStandard()` to detect data standards and automatically generate mappings for the data provided. Values specified in the `customMapping` parameter overwrite auto-generated mappings when both are found. Defaults to true. #' diff --git a/R/makeMeta.R b/R/makeMeta.R index 501f9ef0..0cb5effc 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -77,8 +77,8 @@ makeMeta <- function(charts){ ## combine list of dfs into single df if(length(dfs)>0){ - meta<-bind_rows(dfs) %>% - mutate_at(vars(tidyr::starts_with('standard_')), ~tidyr::replace_na(., "")) + meta<-bind_rows(dfs) + #%>% mutate_at(vars(tidyr::starts_with('standard_')), ~tidyr::replace_na(., "")) # Throw error if duplicate records are found dupes <- duplicated(meta%>%select(.data$domain, .data$text_key)) diff --git a/R/mod_safetyGraphicsServer.R b/R/mod_safetyGraphicsServer.R index 89126bde..0d7e4b85 100644 --- a/R/mod_safetyGraphicsServer.R +++ b/R/mod_safetyGraphicsServer.R @@ -5,7 +5,7 @@ #' @param input Shiny input object #' @param output Shiny output object #' @param session Shiny session object -#' @param meta data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}. +#' @param meta data frame containing the metadata for use in the app. #' @param domainData named list of data.frames to be loaded in to the app. #' @param mapping current mapping #' @param charts list of charts to include in the app diff --git a/R/mod_safetyGraphicsUI.R b/R/mod_safetyGraphicsUI.R index 02f5dc6e..66057d8d 100644 --- a/R/mod_safetyGraphicsUI.R +++ b/R/mod_safetyGraphicsUI.R @@ -2,7 +2,7 @@ #' #' #' @param id module ID -#' @param meta data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}. +#' @param meta data frame containing the metadata for use in the app. #' @param domainData named list of data.frames to be loaded in to the app. #' @param mapping data.frame specifying the initial values for each data mapping. If no mapping is provided, the app will attempt to generate one via \code{detectStandard()} #' @param standards a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard. diff --git a/man/detectStandard.Rd b/man/detectStandard.Rd index dc021561..b627b42c 100644 --- a/man/detectStandard.Rd +++ b/man/detectStandard.Rd @@ -4,14 +4,14 @@ \alias{detectStandard} \title{Detect the data standard used for a data set} \usage{ -detectStandard(data, domain = NULL, meta = safetyGraphics::meta) +detectStandard(data, domain = NULL, meta = NULL) } \arguments{ \item{data}{A data frame in which to detect the data standard - required.} \item{domain}{the domain to evaluate - should match a value of \code{meta$domain}. Uses the first value in \code{meta$domain} if no value is provided.} -\item{meta}{the metadata containing the data standards. - default = safetyGraphics::meta} +\item{meta}{the metadata containing the data standards.} } \value{ A data frame describing the detected standard for each \code{"text_key"} in the provided metadata. Columns are \code{"domain"}, \code{"text_key"}, \code{"column"} and \code{"standard"}. @@ -23,7 +23,7 @@ This function attempts to detect the clinical data standard used in a given R da This function compares the columns in the provided \code{"data"} with the required columns for a given data standard/domain combination. The function is designed to work with the SDTM and ADaM CDISC(\url{https://www.cdisc.org/}) standards for clinical trial data by default. Additional standards can be added by modifying the \code{"meta"} data set included as part of this package. } \examples{ -detectStandard(data=safetyData::adam_adae) #aes domain evaluated by default -detectStandard(data=safetyData::adam_adlbc,domain="labs" ) +detectStandard(data=safetyData::adam_adae, meta=safetyCharts::meta_aes) +detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs, domain="labs" ) } diff --git a/man/evaluateStandard.Rd b/man/evaluateStandard.Rd index 5c8f97b0..f1ef1c25 100644 --- a/man/evaluateStandard.Rd +++ b/man/evaluateStandard.Rd @@ -25,7 +25,7 @@ Determines whether the required data elements in a data standard are found in a # Match is TRUE evaluateStandard( data=safetyData::adam_adlbc, - meta=meta, + meta=safetyCharts::meta_labs, domain="labs", standard="adam" ) @@ -33,7 +33,7 @@ evaluateStandard( # Match is FALSE evaluateStandard( data=safetyData::adam_adlbc, - meta=meta, + meta=safetyCharts::meta_labs, domain="labs", standard="sdtm" ) diff --git a/man/makeMapping.Rd b/man/makeMapping.Rd index 6e8168a0..e4b40b5a 100644 --- a/man/makeMapping.Rd +++ b/man/makeMapping.Rd @@ -9,7 +9,7 @@ makeMapping(domainData, meta, autoMapping, customMapping) \arguments{ \item{domainData}{named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default} -\item{meta}{data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}.} +\item{meta}{data frame containing the metadata for use in the app.} \item{autoMapping}{boolean indicating whether the app should use \code{safetyGraphics::detectStandard()} to detect data standards and automatically generate mappings for the data provided. Values specified in the \code{customMapping} parameter overwrite auto-generated mappings when both are found. Defaults to true.} diff --git a/man/meta.Rd b/man/meta.Rd deleted file mode 100644 index d38e7f71..00000000 --- a/man/meta.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/meta.R -\docType{data} -\name{meta} -\alias{meta} -\title{Metadata data frame containing information about the data mapping used to configure safetyGraphics charts. One record per unique data mapping} -\format{ -A data frame with 31 rows and 7 columns -\describe{ -\item{domain}{Data domain} -\item{text_key}{Text key indicating the setting name. \code{'--'} delimiter indicates a field level data mapping} -\item{col_key}{Key for the column mapping} -\item{field_key}{Key for the field mapping (if any)} -\item{type}{type of mapping - "field" or "column"} -\item{label}{Label} -\item{description}{Description} -\item{multiple}{Mapping supports multiple columns/fields } -\item{standard_adam}{Default values for the ADaM data standard} -\item{standard_sdtm}{Default values for the SDTM data standard} -} -} -\source{ -Created for this package -} -\usage{ -meta -} -\description{ -Metadata data frame containing information about the data mapping used to configure safetyGraphics charts. One record per unique data mapping -} -\keyword{datasets} diff --git a/man/safetyGraphicsServer.Rd b/man/safetyGraphicsServer.Rd index 9ec00b23..ece88603 100644 --- a/man/safetyGraphicsServer.Rd +++ b/man/safetyGraphicsServer.Rd @@ -22,7 +22,7 @@ safetyGraphicsServer( \item{session}{Shiny session object} -\item{meta}{data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}.} +\item{meta}{data frame containing the metadata for use in the app.} \item{mapping}{current mapping} diff --git a/man/safetyGraphicsUI.Rd b/man/safetyGraphicsUI.Rd index ab47189a..99b312a5 100644 --- a/man/safetyGraphicsUI.Rd +++ b/man/safetyGraphicsUI.Rd @@ -9,7 +9,7 @@ safetyGraphicsUI(id, meta, domainData, mapping, standards) \arguments{ \item{id}{module ID} -\item{meta}{data frame containing the metadata for use in the app. See the preloaded file (\code{?safetyGraphics::meta}) for more data specifications and details. Defaults to \code{safetyGraphics::meta}.} +\item{meta}{data frame containing the metadata for use in the app.} \item{domainData}{named list of data.frames to be loaded in to the app.} diff --git a/tests/testthat/module_examples/chartsTab/app.R b/tests/testthat/module_examples/chartsTab/app.R index 013bc3f6..7dbafec6 100644 --- a/tests/testthat/module_examples/chartsTab/app.R +++ b/tests/testthat/module_examples/chartsTab/app.R @@ -14,7 +14,15 @@ domainData <- list( dm=safetyData::adam_adsl ) -mapping <- makeMapping(domainData, meta=safetyGraphics::meta, autoMapping=TRUE, customMapping=NULL) + +meta <- meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + +mapping <- makeMapping(domainData, meta=meta, autoMapping=TRUE, customMapping=NULL) dataR<-reactive({domainData}) mappingR<-reactive({mapping$mapping}) diff --git a/tests/testthat/module_examples/mappingDomain/app.R b/tests/testthat/module_examples/mappingDomain/app.R index a32585d3..31344b3b 100644 --- a/tests/testthat/module_examples/mappingDomain/app.R +++ b/tests/testthat/module_examples/mappingDomain/app.R @@ -2,19 +2,25 @@ library(shiny) library(safetyGraphics) library(dplyr) +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) #reactlogReset() -measure_meta <- safetyGraphics::meta%>%filter(domain=="labs")%>%filter(col_key=="measure_col") +measure_meta <- meta%>%filter(domain=="labs")%>%filter(col_key=="measure_col") mm_default<-data.frame( text_key = c("measure_col", "measure_col--ALP"), current = c("PARAM","Alkaline Phosphatase (U/L)"), stringsAsFactors = FALSE ) -labs_default <- safetyGraphics::meta %>% +labs_default <- meta %>% filter(domain=="labs")%>% mutate(current=standard_sdtm)%>% select(text_key,current) -aes_default <- safetyGraphics::meta %>% +aes_default <- meta %>% filter(domain=="aes")%>% mutate(current=standard_sdtm)%>% select(text_key,current) @@ -35,16 +41,16 @@ ui <- tagList( mappingDomainUI("ex2",measure_meta,safetyData::adam_adlbc,mm_default), tableOutput("ex2Out"), h2("Example 3: AE Domain - no defaults"), - mappingDomainUI("ex3",safetyGraphics::meta%>%filter(domain=="aes"),safetyData::adam_adae), + mappingDomainUI("ex3", meta%>%filter(domain=="aes"),safetyData::adam_adae), tableOutput("ex3Out"), h2("Example 4: AE Domain - with defaults"), - mappingDomainUI("ex4",safetyGraphics::meta%>%filter(domain=="aes"),safetyData::adam_adae, aes_default), + mappingDomainUI("ex4", meta%>%filter(domain=="aes"),safetyData::adam_adae, aes_default), tableOutput("ex4Out"), h2("Example 5: Labs Domain - no defaults"), - mappingDomainUI("ex5",safetyGraphics::meta%>%filter(domain=="labs"),safetyData::adam_adlbc), + mappingDomainUI("ex5", meta%>%filter(domain=="labs"),safetyData::adam_adlbc), tableOutput("ex5Out"), h2("Example 6: Labs Domain - with defaults"), - mappingDomainUI("ex6",safetyGraphics::meta%>%filter(domain=="labs"),safetyData::adam_adlbc,labs_default), + mappingDomainUI("ex6", meta%>%filter(domain=="labs"),safetyData::adam_adlbc,labs_default), tableOutput("ex6Out"), ) ) @@ -57,19 +63,19 @@ server <- function(input,output,session){ exportTestValues(ex2_data = { ex2() }) output$ex2Out<-renderTable(ex2()) - ex3<-callModule(mappingDomain, "ex3", safetyGraphics::meta%>%filter(domain=="aes"), safetyData::adam_adae) + ex3<-callModule(mappingDomain, "ex3", meta%>%filter(domain=="aes"), safetyData::adam_adae) exportTestValues(ex3_data = { ex3() }) output$ex3Out<-renderTable(ex3()) - ex4<-callModule(mappingDomain, "ex4", safetyGraphics::meta%>%filter(domain=="aes"), safetyData::adam_adae) + ex4<-callModule(mappingDomain, "ex4", meta%>%filter(domain=="aes"), safetyData::adam_adae) exportTestValues(ex4_data = { ex4() }) output$ex4Out<-renderTable(ex4()) - ex5<-callModule(mappingDomain, "ex5", safetyGraphics::meta%>%filter(domain=="labs"), safetyData::adam_adlbc) + ex5<-callModule(mappingDomain, "ex5", meta%>%filter(domain=="labs"), safetyData::adam_adlbc) exportTestValues(ex5_data = { ex5() }) output$ex5Out<-renderTable(ex5()) - ex6<-callModule(mappingDomain, "ex6", safetyGraphics::meta%>%filter(domain=="labs"), labsafetyData::adam_adlbcs) + ex6<-callModule(mappingDomain, "ex6", meta%>%filter(domain=="labs"), labsafetyData::adam_adlbcs) exportTestValues(ex6_data = { ex6() }) output$ex6Out<-renderTable(ex6()) diff --git a/tests/testthat/module_examples/settingsMapping/app.R b/tests/testthat/module_examples/settingsMapping/app.R index a1f597ca..50669117 100644 --- a/tests/testthat/module_examples/settingsMapping/app.R +++ b/tests/testthat/module_examples/settingsMapping/app.R @@ -7,6 +7,13 @@ partialMapping <- data.frame( current=c("ID","myID","measure") ) +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + fullMapping<-read.csv('custom_mapping.csv') ui <- tagList( @@ -27,9 +34,9 @@ ui <- tagList( ) ) server <- function(input,output,session){ - callModule(settingsMapping, "NoMapping", metaIn = safetyGraphics::meta) - callModule(settingsMapping, "PartialMapping", metaIn = safetyGraphics::meta, mapping=reactive({partialMapping}) ) - callModule(settingsMapping, "FullMapping", metaIn = safetyGraphics::meta, mapping=reactive({fullMapping})) + callModule(settingsMapping, "NoMapping", metaIn = meta) + callModule(settingsMapping, "PartialMapping", metaIn = meta, mapping=reactive({partialMapping}) ) + callModule(settingsMapping, "FullMapping", metaIn = meta, mapping=reactive({fullMapping})) } shinyApp(ui, server) \ No newline at end of file diff --git a/tests/testthat/test_detectStandard.R b/tests/testthat/test_detectStandard.R index bef136cf..69e4224f 100644 --- a/tests/testthat/test_detectStandard.R +++ b/tests/testthat/test_detectStandard.R @@ -4,7 +4,7 @@ library(safetyData) library(stringr) test_that("a list with the expected properties and structure is returned",{ - a<- detectStandard(data.frame()) + a<- detectStandard(data.frame(),meta=safetyCharts::meta_labs) expect_is(a,"list") expect_named(a,c("details","standard","label","standard_percent")) @@ -18,45 +18,43 @@ test_that("a list with the expected properties and structure is returned",{ }) test_that("correct standards are identified",{ - expect_equal(detectStandard(data=safetyData::adam_adlbc,domain='labs')[["standard"]],"adam") - expect_equal(detectStandard(data=safetyData::adam_adlbc,domain='labs')[["details"]][["sdtm"]][["match"]], "partial") - expect_equal(detectStandard(data=safetyData::adam_adlbc,domain='labs')[["details"]][["adam"]][["match"]], "full") + expect_equal(detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs,domain='labs')[["standard"]],"adam") + expect_equal(detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs,domain='labs')[["details"]][["sdtm"]][["match"]], "partial") + expect_equal(detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs,domain='labs')[["details"]][["adam"]][["match"]], "full") adam_params <- c("Alanine Aminotransferase (U/L)","Aspartate Aminotransferase (U/L)","Bilirubin (umol/L)","Alkaline Phosphatase (U/L)") adam_test_data<-data.frame(USUBJID="001",AVAL=10,PARAM=adam_params,VISIT="Visit 1",VISITNUM=1,ADY=0,A1LO=0,A1HI=20,PARAMCD="K") - expect_equal(detectStandard(data=adam_test_data, domain="labs")[["standard"]],"adam") - expect_equal(detectStandard(data=adam_test_data, domain="labs")[["details"]][["adam"]][["match"]], "full") - expect_equal(detectStandard(data=adam_test_data, domain="labs")[["details"]][["sdtm"]][["match"]], "partial") + expect_equal(detectStandard(data=adam_test_data, meta=safetyCharts::meta_labs, domain="labs")[["standard"]],"adam") + expect_equal(detectStandard(data=adam_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["adam"]][["match"]], "full") + expect_equal(detectStandard(data=adam_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["sdtm"]][["match"]], "partial") sdtm_params<-c("Alanine Aminotransferase","Aspartate Aminotransferase","Bilirubin","Alkaline Phosphatase") sdtm_test_data<-data.frame(USUBJID="001",LBSTRESN=10,LBTEST=sdtm_params,VISIT="Visit 1",VISITNUM=1,LBDY=0,LBSTNRLO=0,LBSTNRHI=20,LBSTRESU="K") - expect_equal(detectStandard(sdtm_test_data, domain="labs")[["standard"]],"sdtm") - expect_equal(detectStandard(sdtm_test_data, domain="labs")[["details"]][["sdtm"]][["match"]], "full") - expect_equal(detectStandard(sdtm_test_data, domain="labs")[["details"]][["adam"]][["match"]], "partial") + expect_equal(detectStandard(sdtm_test_data, meta=safetyCharts::meta_labs, domain="labs")[["standard"]],"sdtm") + expect_equal(detectStandard(sdtm_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["sdtm"]][["match"]], "full") + expect_equal(detectStandard(sdtm_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["adam"]][["match"]], "partial") empty_test_data<-data.frame("") - expect_equal(detectStandard(empty_test_data)[["standard"]],"none") - expect_equal(detectStandard(empty_test_data)[["details"]][["adam"]][["match"]], "none") - expect_equal(detectStandard(empty_test_data)[["details"]][["sdtm"]][["match"]], "none") + expect_equal(detectStandard(empty_test_data, meta=safetyCharts::meta_labs)[["standard"]],"none") + expect_equal(detectStandard(empty_test_data, meta=safetyCharts::meta_labs)[["details"]][["adam"]][["match"]], "none") + expect_equal(detectStandard(empty_test_data, meta=safetyCharts::meta_labs)[["details"]][["sdtm"]][["match"]], "none") case_sensitive_test_data<-data.frame(usubjid="001",AVAL=10,PARAM=adam_params,VISIT="Visit 1",VISITNUM=1,ADY=0,A1LO=0,A1HI=20,PARAMCD="K") - expect_equal(detectStandard(case_sensitive_test_data, domain="labs")[["standard"]],"adam") - expect_equal(detectStandard(case_sensitive_test_data, domain="labs")[["details"]][["adam"]][["match"]], "full") - expect_equal(detectStandard(case_sensitive_test_data, domain="labs")[["details"]][["sdtm"]][["match"]], "partial") + expect_equal(detectStandard(case_sensitive_test_data, meta=safetyCharts::meta_labs, domain="labs")[["standard"]],"adam") + expect_equal(detectStandard(case_sensitive_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["adam"]][["match"]], "full") + expect_equal(detectStandard(case_sensitive_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["sdtm"]][["match"]], "partial") #NOTE: adam takes precedence over sdtm sdtm_and_adam_test_data<-cbind(adam_test_data,sdtm_test_data) - expect_equal(detectStandard(sdtm_and_adam_test_data, domain="labs")[["standard"]],"adam") - expect_equal(detectStandard(sdtm_and_adam_test_data, domain="labs")[["details"]][["adam"]][["match"]], "full") - expect_equal(detectStandard(sdtm_and_adam_test_data, domain="labs")[["details"]][["sdtm"]][["match"]], "full") + expect_equal(detectStandard(sdtm_and_adam_test_data, meta=safetyCharts::meta_labs, domain="labs")[["standard"]],"adam") + expect_equal(detectStandard(sdtm_and_adam_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["adam"]][["match"]], "full") + expect_equal(detectStandard(sdtm_and_adam_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["sdtm"]][["match"]], "full") #NOTE: adam takes precedence over sdtm in partial matches as well sdtm_and_adam_partial_test_data<-data.frame(USUBJID="001",VISIT="Visit 1") - expect_equal(detectStandard(sdtm_and_adam_partial_test_data, domain="labs")[["standard"]],"adam") - expect_equal(detectStandard(sdtm_and_adam_partial_test_data, domain="labs")[["details"]][["adam"]][["match"]],"partial") - expect_equal(detectStandard(sdtm_and_adam_partial_test_data, domain="labs")[["details"]][["sdtm"]][["match"]],"partial") - - + expect_equal(detectStandard(sdtm_and_adam_partial_test_data, meta=safetyCharts::meta_labs, domain="labs")[["standard"]],"adam") + expect_equal(detectStandard(sdtm_and_adam_partial_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["adam"]][["match"]],"partial") + expect_equal(detectStandard(sdtm_and_adam_partial_test_data, meta=safetyCharts::meta_labs, domain="labs")[["details"]][["sdtm"]][["match"]],"partial") }) diff --git a/tests/testthat/test_evaluateStandard.R b/tests/testthat/test_evaluateStandard.R index 5879a51e..a446b6ed 100644 --- a/tests/testthat/test_evaluateStandard.R +++ b/tests/testthat/test_evaluateStandard.R @@ -2,16 +2,15 @@ context("Tests for the evaluateStandard() function") library(safetyGraphics) test_that("basic test cases evaluate as expected",{ - expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta= meta, standard="sdtm")[["match"]],"partial") - expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta= meta, standard="adam")[["match"]],"full") - expect_equal(evaluateStandard(data=safetyData::adam_adae, domain="aes", meta= meta, standard="sdtm")[["match"]],"partial") - expect_equal(evaluateStandard(data=safetyData::adam_adae, domain="aes", meta= meta, standard="adam")[["match"]],"full") - expect_equal(evaluateStandard(data=data.frame(), domain="labs", meta= meta, standard="sdtm")[["match"]],"none") + expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta= safetyCharts::meta_labs, standard="sdtm")[["match"]],"partial") + expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta= safetyCharts::meta_labs, standard="adam")[["match"]],"full") + expect_equal(evaluateStandard(data=safetyData::adam_adae, domain="aes", meta= safetyCharts::meta_aes, standard="sdtm")[["match"]],"partial") + expect_equal(evaluateStandard(data=safetyData::adam_adae, domain="aes", meta= safetyCharts::meta_aes, standard="adam")[["match"]],"full") + expect_equal(evaluateStandard(data=data.frame(), domain="labs", meta= safetyCharts::meta_labs, standard="sdtm")[["match"]],"none") }) test_that("a list with the expected properties and structure is returned",{ - a<- evaluateStandard(data=data.frame(),domain="labs", meta=meta, standard="adam") - + a<- evaluateStandard(data=data.frame(),domain="labs", meta=safetyCharts::meta_labs, standard="adam") expect_is(a,"list") expect_named(a,c('standard', 'mapping', 'total_count','valid_count', 'invalid_count','match_percent', 'match',"label")) expect_is(a[["standard"]],"character") @@ -22,26 +21,25 @@ test_that("a list with the expected properties and structure is returned",{ }) test_that("expected number of checks (in)valid",{ - expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta=meta, standard="sdtm")[["valid_count"]],4) - expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta=meta, standard="sdtm")[["invalid_count"]],9) + expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta=safetyCharts::meta_labs, standard="sdtm")[["valid_count"]],4) + expect_equal(evaluateStandard(data=safetyData::adam_adlbc, domain="labs", meta=safetyCharts::meta_labs, standard="sdtm")[["invalid_count"]],5) labs_edit <- safetyData::adam_adlbc labs_edit$LBTEST <- labs_edit$PARAM - a<-evaluateStandard(data=labs_edit, domain="labs", meta=meta, standard="sdtm") + a<-evaluateStandard(data=labs_edit, domain="labs", meta=safetyCharts::meta_labs, standard="sdtm") expect_equal(a[["valid_count"]],5) - expect_equal(a[["invalid_count"]],8) - expect_equal(a[["total_count"]],13) - expect_equal(round(a[["match_percent"]],3), .385) + expect_equal(a[["invalid_count"]],4) + expect_equal(a[["total_count"]],9) + expect_equal(a[["match_percent"]], 5/9) expect_true(a[["mapping"]]%>%filter(text_key=="measure_col")%>%select(valid)%>%unlist) }) test_that("invalid options throw errors",{ - expect_error(evaluateStandard(data=list(a=1,b=2), domain="labs", meta=meta, standard="sdtm")) - expect_error(evaluateStandard(data="notadataframe",domain="labs", meta=meta, standard="sdtm")) - expect_error(evaluateStandard(data=safetyData::adam_adlbc,domain="labs", meta=meta, standard=123)) - expect_error(evaluateStandard(data=safetyData::adam_adlbc,domain="labs", meta=meta, standard="notarealstandard")) - expect_error(evaluateStandard(data=safetyData::adam_adlbc,domain="labs", meta=meta, standard="adam", includeFieldsIsNotAnOptionNow="yesPlease")) + expect_error(evaluateStandard(data=list(a=1,b=2), domain="labs", meta=safetyCharts::meta_labs, standard="sdtm")) + expect_error(evaluateStandard(data="notadataframe",domain="labs", meta=safetyCharts::meta_labs, standard="sdtm")) + expect_error(evaluateStandard(data=safetyData::adam_adlbc,domain="labs", meta=safetyCharts::meta_labs, standard="notarealstandard")) + expect_error(evaluateStandard(data=safetyData::adam_adlbc,domain="labs", meta=safetyCharts::meta_labs, standard="adam", includeFieldsIsNotAnOptionNow="yesPlease")) expect_error(evaluateStandard(data=safetyData::adam_adlbc,domain="labs", meta=list(), standard="sdtm")) expect_error(evaluateStandard(data=safetyData::adam_adlbc,domain="labs", meta=safetyData::adam_adlbc, standard="sdtm")) }) \ No newline at end of file diff --git a/tests/testthat/test_makeMapping.R b/tests/testthat/test_makeMapping.R index ada8b40d..c28d962a 100644 --- a/tests/testthat/test_makeMapping.R +++ b/tests/testthat/test_makeMapping.R @@ -9,15 +9,22 @@ testData<- list( dm=safetyData::adam_adsl ) +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + myCustomMapping<-list( aes = list(id_col='USUBJID', seq_col='MY_SEQ'), labs = list(id_col='customID') ) -ex1<-makeMapping(testData, safetyGraphics::meta, TRUE, NULL) -ex2<-makeMapping(testData, safetyGraphics::meta, FALSE, NULL) -ex3<-makeMapping(testData, safetyGraphics::meta, TRUE, myCustomMapping) -ex4<-makeMapping(testData, safetyGraphics::meta, FALSE, myCustomMapping) +ex1<-makeMapping(testData, meta, TRUE, NULL) +ex2<-makeMapping(testData, meta, FALSE, NULL) +ex3<-makeMapping(testData, meta, TRUE, myCustomMapping) +ex4<-makeMapping(testData, meta, FALSE, myCustomMapping) test_that("object with the correct properties is returned",{ expect_named(ex1, c("standard", "mapping")) @@ -77,7 +84,7 @@ test_that("customMapping overwrites autoMapping values",{ test_that("unique domains in customMapping are added",{ myCustomMapping2 <- myCustomMapping myCustomMapping2$customDomain <- list(id_col="customID", other_col="other") - ex5<-makeMapping(testData, safetyGraphics::meta, TRUE, myCustomMapping2) + ex5<-makeMapping(testData, meta, TRUE, myCustomMapping2) expect_equal(unique(ex5$mapping$domain), c("aes", "labs", "customDomain", "dm")) #2 rows added @@ -93,7 +100,7 @@ test_that("unique domains in customMapping are added",{ test_that("unique mapping values for existing domains in customMapping are added",{ myCustomMapping3 <- myCustomMapping myCustomMapping3$aes$other_col <- "other" - ex6<-makeMapping(testData, safetyGraphics::meta, TRUE, myCustomMapping3) + ex6<-makeMapping(testData, meta, TRUE, myCustomMapping3) #1 row added expect_equal(nrow(ex6$mapping), nrow(ex1$mapping)+1) @@ -106,7 +113,7 @@ test_that("nested values in custom mapping work as expected",{ myCustomMapping4$labs$measure_values$ALT <- "AnotherAlt" myCustomMapping4$labs$measure_values$OTHER <- "Other" myCustomMapping4$aes$fake_values <- list(other1="Other1", other2="other2") - ex7<-makeMapping(testData, safetyGraphics::meta, TRUE, myCustomMapping4) + ex7<-makeMapping(testData, meta, TRUE, myCustomMapping4) #1 row added expect_equal(nrow(ex7$mapping), nrow(ex1$mapping)+3) diff --git a/tests/testthat/test_mod_mappingColumn.R b/tests/testthat/test_mod_mappingColumn.R index c41612d7..5f8eb487 100644 --- a/tests/testthat/test_mod_mappingColumn.R +++ b/tests/testthat/test_mod_mappingColumn.R @@ -8,6 +8,13 @@ skip_on_cran() app <- ShinyDriver$new("./module_examples/mappingColumn") initial<-app$getAllValues() +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + test_that("UI function stops with invalid inputs (non-data.frame)",{ skip_on_cran() id_meta <- meta%>%filter(domain=="labs")%>%filter(col_key=="id_col") diff --git a/tests/testthat/test_mod_mappingDomain.R b/tests/testthat/test_mod_mappingDomain.R index 51d9eeb2..01c94519 100644 --- a/tests/testthat/test_mod_mappingDomain.R +++ b/tests/testthat/test_mod_mappingDomain.R @@ -6,13 +6,20 @@ library(testthat) library(stringr) library(dplyr) +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + skip_on_cran() app <- ShinyDriver$new("./module_examples/mappingDomain") initial<-app$getAllValues() test_that("UI function stops with invalid inputs (non-data.frame)",{ skip_on_cran() - id_meta <- safetyGraphics::meta%>%filter(domain=="labs")%>%filter(col_key=="id_col") + id_meta <- meta%>%filter(domain=="labs")%>%filter(col_key=="id_col") id_mapping_list<-list(id_col="USUBJID") expect_error(mappingDomainUI("test1.1", list(id_col="USUBJID"), safetyData::adam_adlbc)) #invalid metadata expect_error(mappingDomainUI("test1.2", id_meta, "invalid_data_option")) #invalid data @@ -24,10 +31,10 @@ test_that("the correct number of inputs are created (1 per field/column)",{ inputs <- names(initial$input) expect_length(str_subset(inputs,"ex1"),5) expect_length(str_subset(inputs,"ex2"),5) - expect_length(str_subset(inputs,"ex3"),nrow(safetyGraphics::meta %>% filter(domain=="aes"))) - expect_length(str_subset(inputs,"ex4"),nrow(safetyGraphics::meta %>% filter(domain=="aes"))) - expect_length(str_subset(inputs,"ex5"),nrow(safetyGraphics::meta %>% filter(domain=="labs"))) - expect_length(str_subset(inputs,"ex6"),nrow(safetyGraphics::meta %>% filter(domain=="labs"))) + expect_length(str_subset(inputs,"ex3"),nrow( meta %>% filter(domain=="aes"))) + expect_length(str_subset(inputs,"ex4"),nrow( meta %>% filter(domain=="aes"))) + expect_length(str_subset(inputs,"ex5"),nrow( meta %>% filter(domain=="labs"))) + expect_length(str_subset(inputs,"ex6"),nrow( meta %>% filter(domain=="labs"))) }) test_that("output are data frames with the have expected values",{ @@ -41,10 +48,10 @@ test_that("output are data frames with the have expected values",{ #all exported values have the correct number of rows expect_equal(nrow(initial$export$ex1_data),5) expect_equal(nrow(initial$export$ex2_data),5) - expect_equal(nrow(initial$export$ex3_data),nrow(safetyGraphics::meta %>% filter(domain=="aes"))) - expect_equal(nrow(initial$export$ex4_data),nrow(safetyGraphics::meta %>% filter(domain=="aes"))) - expect_equal(nrow(initial$export$ex5_data),nrow(safetyGraphics::meta %>% filter(domain=="labs"))) - expect_equal(nrow(initial$export$ex6_data),nrow(safetyGraphics::meta %>% filter(domain=="labs"))) + expect_equal(nrow(initial$export$ex3_data),nrow( meta %>% filter(domain=="aes"))) + expect_equal(nrow(initial$export$ex4_data),nrow( meta %>% filter(domain=="aes"))) + expect_equal(nrow(initial$export$ex5_data),nrow( meta %>% filter(domain=="labs"))) + expect_equal(nrow(initial$export$ex6_data),nrow( meta %>% filter(domain=="labs"))) }) From e1c403856d50e93183e718dba79b1a5093d7e094 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Mon, 28 Feb 2022 10:19:09 -0500 Subject: [PATCH 26/41] update test apps --- tests/testthat/module_examples/filterTab/app.R | 8 ++++++++ tests/testthat/module_examples/mapping/app.R | 9 +++++++++ tests/testthat/module_examples/mappingColumn/app.R | 8 ++++++++ 3 files changed, 25 insertions(+) diff --git a/tests/testthat/module_examples/filterTab/app.R b/tests/testthat/module_examples/filterTab/app.R index 4bba9255..63f5575f 100644 --- a/tests/testthat/module_examples/filterTab/app.R +++ b/tests/testthat/module_examples/filterTab/app.R @@ -5,6 +5,14 @@ library(safetyGraphics) #reactlogReset() +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + + ui <- tagList( shinyjs::useShinyjs(), tags$head( diff --git a/tests/testthat/module_examples/mapping/app.R b/tests/testthat/module_examples/mapping/app.R index 743853bc..188aa6af 100644 --- a/tests/testthat/module_examples/mapping/app.R +++ b/tests/testthat/module_examples/mapping/app.R @@ -2,6 +2,15 @@ library(shiny) library(safetyGraphics) library(dplyr) + +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + + #reactlogReset() allData <- list(labs=safetyData::adam_adlbc, aes=safetyData::adam_adae) labs_default <- meta %>% diff --git a/tests/testthat/module_examples/mappingColumn/app.R b/tests/testthat/module_examples/mappingColumn/app.R index 86c813e1..c4f58159 100644 --- a/tests/testthat/module_examples/mappingColumn/app.R +++ b/tests/testthat/module_examples/mappingColumn/app.R @@ -4,6 +4,14 @@ library(dplyr) reactlogReset() +meta <- rbind( + safetyCharts::meta_labs, + safetyCharts::meta_aes, + safetyCharts::meta_dm, + safetyCharts::meta_hepExplorer +) + + id_meta <- meta%>%filter(domain=="labs")%>%filter(col_key=="id_col") measure_meta <- meta%>%filter(domain=="labs")%>%filter(col_key=="measure_col") id_default<-data.frame( From 29cae989158b9c2701d249bee9e69c65b98dab74 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Mon, 28 Feb 2022 10:39:59 -0500 Subject: [PATCH 27/41] return placeholder object for evaluation of data when no defaults are provided for a given standard --- R/evaluateStandard.R | 45 +++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/R/evaluateStandard.R b/R/evaluateStandard.R index 97679604..55c8a128 100644 --- a/R/evaluateStandard.R +++ b/R/evaluateStandard.R @@ -74,32 +74,43 @@ evaluateStandard <- function(data, meta, domain, standard){ )%>% select(.data$text_key, .data$current, .data$valid) - stopifnot(nrow(compare_summary[["mapping"]])>0) - - # count valid/invalid data elements - compare_summary[["total_count"]] <- compare_summary[["mapping"]] %>% nrow() - compare_summary[["valid_count"]] <- compare_summary[["mapping"]] %>% filter(.data$valid) %>% nrow() - compare_summary[["invalid_count"]] <- compare_summary[["mapping"]] %>% filter(!.data$valid) %>% nrow() - compare_summary[["match_percent"]] <- compare_summary[["valid_count"]] / compare_summary[["total_count"]] - - standard_formatted <- standard + standard_formatted <- standard if(standard=="adam"){ standard_formatted = "ADaM" }else if(standard=="sdtm"){ standard_formatted="SDTM" } - if (compare_summary[["invalid_count"]]==0) { - compare_summary[["match"]] <- "full" - compare_summary[["label"]] <- standard_formatted - } else if(compare_summary[["valid_count"]]>0) { - compare_summary[["match"]] <- "partial" - compare_summary[["label"]] <- paste0("Partial ",standard_formatted) - compare_summary[["details"]]<-paste0("(", compare_summary[["valid_count"]], "/" ,compare_summary[["total_count"]], " cols/fields matched)") - } else { + if(nrow(compare_summary[["mapping"]])>0){ + # count valid/invalid data elements + compare_summary[["total_count"]] <- compare_summary[["mapping"]] %>% nrow() + compare_summary[["valid_count"]] <- compare_summary[["mapping"]] %>% filter(.data$valid) %>% nrow() + compare_summary[["invalid_count"]] <- compare_summary[["mapping"]] %>% filter(!.data$valid) %>% nrow() + compare_summary[["match_percent"]] <- compare_summary[["valid_count"]] / compare_summary[["total_count"]] + + if (compare_summary[["invalid_count"]]==0) { + compare_summary[["match"]] <- "full" + compare_summary[["label"]] <- standard_formatted + } else if(compare_summary[["valid_count"]]>0) { + compare_summary[["match"]] <- "partial" + compare_summary[["label"]] <- paste0("Partial ",standard_formatted) + compare_summary[["details"]]<-paste0("(", compare_summary[["valid_count"]], "/" ,compare_summary[["total_count"]], " cols/fields matched)") + } else { + compare_summary[["match"]] <- "none" + compare_summary[["label"]] <- "No Match" + } + }else{ + # No values provided for standard in this domain + compare_summary[["total_count"]] <- 0 + compare_summary[["valid_count"]] <- NA + compare_summary[["invalid_count"]] <- NA + compare_summary[["match_percent"]] <- 0 compare_summary[["match"]] <- "none" compare_summary[["label"]] <- "No Match" } + + + return(compare_summary) } \ No newline at end of file From 7c1e52cc3b47f976cfd263542d9f7b3174abd9ba Mon Sep 17 00:00:00 2001 From: jwildfire Date: Sat, 19 Mar 2022 06:04:35 -0400 Subject: [PATCH 28/41] Update R/makeMeta.R Co-authored-by: Eli Miller --- R/makeMeta.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/makeMeta.R b/R/makeMeta.R index 0cb5effc..bebe067d 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -1,6 +1,6 @@ #' Create a metadata object table for a set of charts #' -#' Generates metadata object for a list charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. +#' Generates metadata object for a list of charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. #' #' @param charts list of safetyGraphics chart objects for which to create metadata #' From aeff1b7b947340276f00e083f075d5a201534d03 Mon Sep 17 00:00:00 2001 From: jwildfire Date: Sat, 19 Mar 2022 06:04:45 -0400 Subject: [PATCH 29/41] Update DESCRIPTION Co-authored-by: Eli Miller --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7f6b463c..af322d79 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,7 +44,7 @@ Imports: shinyjs (>= 2.0.0), sortable (>= 0.4.4), stringr (>= 1.4.0), - tidyr, + tidyr (>= 1.2.0), yaml (>= 2.2.1) VignetteBuilder: knitr Roxygen: list(markdown = TRUE) From 691a3bb9a4cbe6a9c7ad5609c52e37a2dad8c623 Mon Sep 17 00:00:00 2001 From: jwildfire Date: Sat, 19 Mar 2022 06:05:23 -0400 Subject: [PATCH 30/41] Update tests/testthat/module_examples/chartsTab/app.R Co-authored-by: Eli Miller --- tests/testthat/module_examples/chartsTab/app.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/module_examples/chartsTab/app.R b/tests/testthat/module_examples/chartsTab/app.R index 7dbafec6..b7feeeec 100644 --- a/tests/testthat/module_examples/chartsTab/app.R +++ b/tests/testthat/module_examples/chartsTab/app.R @@ -15,7 +15,7 @@ domainData <- list( ) -meta <- meta <- rbind( +meta <- rbind( safetyCharts::meta_labs, safetyCharts::meta_aes, safetyCharts::meta_dm, From b477a0037e676aab14f0338b814c9ebed4eb2e0a Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sat, 19 Mar 2022 06:13:27 -0400 Subject: [PATCH 31/41] update docs --- man/makeMeta.Rd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/makeMeta.Rd b/man/makeMeta.Rd index c6301bcf..e88bf660 100644 --- a/man/makeMeta.Rd +++ b/man/makeMeta.Rd @@ -25,5 +25,5 @@ tibble of metadata with the following columns: } } \description{ -Generates metadata object for a list charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. +Generates metadata object for a list of charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. } From d98b86480a6a9c68a3ee5b126e1955280372f292 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sat, 19 Mar 2022 06:53:14 -0400 Subject: [PATCH 32/41] update docs --- R/makeMeta.R | 6 +++++- man/makeMeta.Rd | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/R/makeMeta.R b/R/makeMeta.R index bebe067d..d26e9a82 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -1,6 +1,10 @@ #' Create a metadata object table for a set of charts #' -#' Generates metadata object for a list of charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. +#' Generates metadata object for a list of charts. `makeMeta()` looks for metadata in 3 locations for each `chart` object: +#' - Domain-level metadata saved as meta_{chart$name} in the chart$package namespace +#' - Chart-specific metadata saved as meta_{chart$domain} in the chart$package namespace +#' - Chart-specific metadata saved directly to the chart object as chart$meta +#' After checking all charts, all metadata files are stacked in to a single dataframe and returned. If duplicate metadata rows (domain + text_key) are found, an error is thrown. #' #' @param charts list of safetyGraphics chart objects for which to create metadata #' diff --git a/man/makeMeta.Rd b/man/makeMeta.Rd index e88bf660..60050fa2 100644 --- a/man/makeMeta.Rd +++ b/man/makeMeta.Rd @@ -25,5 +25,11 @@ tibble of metadata with the following columns: } } \description{ -Generates metadata object for a list of charts. makeMeta() looks in chart$package namespace for files called meta_{chart$name} and meta_{chart$domain} for all charts, and then stacks all files. If duplicate metadata rows (domain + text_key) are found an error is thrown. +Generates metadata object for a list of charts. \code{makeMeta()} looks for metadata in 3 locations for each \code{chart} object: +\itemize{ +\item Domain-level metadata saved as meta_{chart$name} in the chart$package namespace +\item Chart-specific metadata saved as meta_{chart$domain} in the chart$package namespace +\item Chart-specific metadata saved directly to the chart object as chart$meta +After checking all charts, all metadata files are stacked in to a single dataframe and returned. If duplicate metadata rows (domain + text_key) are found, an error is thrown. +} } From 5d4fa751f57f6e77115dea74392512e0ff851fd8 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 24 Mar 2022 09:30:14 -0400 Subject: [PATCH 33/41] update rclipboard calls. fix #663 --- R/mod_settingsCode.R | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/R/mod_settingsCode.R b/R/mod_settingsCode.R index a778bfc0..6280c131 100644 --- a/R/mod_settingsCode.R +++ b/R/mod_settingsCode.R @@ -116,7 +116,12 @@ settingsCode <- function(input, output, session, mapping, charts, domainData){ }) output$mappingText <- renderText({mappingString()}) output$mappingCopy <- renderUI({ - rclipboard::rclipButton("clipbtn", "Copy to Clipboard", mappingString(), icon("clipboard")) + rclipboard::rclipButton( + inputId="clipbtn", + label="Copy to Clipboard", + clipText=mappingString(), + icon=icon("clipboard") + ) }) output$mappingDownload <- downloadHandler( filename = "mapping.yaml", @@ -134,7 +139,12 @@ settingsCode <- function(input, output, session, mapping, charts, domainData){ chartsString <- as.yaml(charts_raw) output$chartsText <- renderText({chartsString}) output$chartsCopy <- renderUI({ - rclipboard::rclipButton("clipbtn", "Copy to Clipboard", chartsString, icon("clipboard")) + rclipboard::rclipButton( + inputId="clipbtn", + label="Copy to Clipboard", + clipText=chartsString, + icon=icon("clipboard") + ) }) output$chartsDownload <- downloadHandler( filename = "charts.yaml", @@ -167,7 +177,12 @@ settingsCode <- function(input, output, session, mapping, charts, domainData){ ) output$initText <- renderText(initString) output$initCopy <- renderUI({ - rclipboard::rclipButton("clipbtn2", "Copy to Clipboard", initString, icon("clipboard")) + rclipboard::rclipButton( + inputId="clipbtn2", + label="Copy to Clipboard", + clipText=initString, + icon=icon("clipboard") + ) }) output$initDownload <- downloadHandler( filename = "initApp.R", From 345658726dd28fe339ec1da5000f195c8d4218f3 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 24 Mar 2022 13:25:36 -0400 Subject: [PATCH 34/41] sync vignettes with wiki. rebuild pkgdown. --- _pkgdown.yml | 7 +- docs/404.html | 14 +- docs/LICENSE-text.html | 4 +- docs/LICENSE.html | 4 +- docs/articles/Cookbook.html | 229 +++++++++++++++--- .../header-attrs-2.13/header-attrs.js | 12 + docs/articles/TechnicalFAQ.html | 115 +++++---- .../header-attrs-2.13/header-attrs.js | 12 + docs/articles/chartConfiguration.html | 95 ++++++-- .../header-attrs-2.13/header-attrs.js | 12 + docs/articles/index.html | 4 +- docs/articles/intro.html | 26 +- .../header-attrs-2.13/header-attrs.js | 12 + docs/authors.html | 4 +- docs/index.html | 4 +- docs/news/index.html | 6 +- docs/pkgdown.yml | 6 +- docs/reference/SafetyGraphics.html | 4 +- docs/reference/app_startup.html | 6 +- docs/reference/chartsNav.html | 4 +- docs/reference/chartsTab.html | 4 +- docs/reference/chartsTabUI.html | 4 +- docs/reference/detectStandard.html | 176 +++++++------- docs/reference/evaluateStandard.html | 74 +++--- docs/reference/filterTab.html | 4 +- docs/reference/filterTabChecks.html | 4 +- docs/reference/filterTabUI.html | 4 +- docs/reference/generateMappingList.html | 4 +- docs/reference/hasColumn.html | 4 +- docs/reference/hasField.html | 4 +- docs/reference/homeTab.html | 4 +- docs/reference/homeTabUI.html | 4 +- docs/reference/index.html | 29 +-- docs/reference/loadCharts.html | 4 +- docs/reference/loadChartsUI.html | 4 +- docs/reference/loadData.html | 4 +- docs/reference/loadDataUI.html | 4 +- docs/reference/makeChartConfig.html | 6 +- docs/reference/makeChartExport.html | 4 +- docs/reference/makeChartParams.html | 4 +- docs/reference/makeChartSummary.html | 4 +- docs/reference/makeMapping.html | 6 +- docs/reference/makeMeta.html | 211 ++++++++++++++++ docs/reference/mappingColumn.html | 4 +- docs/reference/mappingColumnUI.html | 4 +- docs/reference/mappingDomain.html | 4 +- docs/reference/mappingDomainUI.html | 4 +- docs/reference/mappingSelect.html | 4 +- docs/reference/mappingSelectUI.html | 4 +- docs/reference/mappingTab.html | 4 +- docs/reference/mappingTabUI.html | 4 +- docs/reference/prepareChart.html | 4 +- docs/reference/safetyGraphicsApp.html | 15 +- docs/reference/safetyGraphicsInit.html | 4 +- docs/reference/safetyGraphicsServer.html | 6 +- docs/reference/safetyGraphicsUI.html | 6 +- docs/reference/setMappingListValue.html | 4 +- docs/reference/settingsCharts.html | 4 +- docs/reference/settingsChartsUI.html | 4 +- docs/reference/settingsCode.html | 4 +- docs/reference/settingsCodeUI.html | 4 +- docs/reference/settingsData.html | 4 +- docs/reference/settingsDataUI.html | 4 +- docs/reference/settingsMapping.html | 4 +- docs/reference/settingsMappingUI.html | 4 +- docs/reference/settingsTab.html | 4 +- docs/reference/settingsTabUI.html | 4 +- docs/reference/textKeysToList.html | 4 +- docs/sitemap.xml | 110 ++++----- vignettes/Cookbook.Rmd | 216 ++++++++++++++--- vignettes/TechnicalFAQ.Rmd | 97 ++++---- vignettes/chartConfiguration.Rmd | 107 +++++--- vignettes/intro.Rmd | 25 +- 73 files changed, 1257 insertions(+), 563 deletions(-) create mode 100644 docs/articles/Cookbook_files/header-attrs-2.13/header-attrs.js create mode 100644 docs/articles/TechnicalFAQ_files/header-attrs-2.13/header-attrs.js create mode 100644 docs/articles/chartConfiguration_files/header-attrs-2.13/header-attrs.js create mode 100644 docs/articles/intro_files/header-attrs-2.13/header-attrs.js create mode 100644 docs/reference/makeMeta.html diff --git a/_pkgdown.yml b/_pkgdown.yml index 7539e8eb..2decb1e6 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://pages.github.com/SafetyGraphics/safetyGraphics +url: https://safetygraphics.github.io/safetyGraphics/ template: params: @@ -68,10 +68,6 @@ reference: - settingsMappingUI - settingsCode - settingsCodeUI - - title: Data - desc: Data sets used in the apps - contents: - - meta - title: Helper Functions desc: Utility functions used in the apps contents: @@ -86,4 +82,5 @@ reference: - makeChartParams - makeChartSummary - makeMapping + - makeMeta - prepareChart diff --git a/docs/404.html b/docs/404.html index 1013dc52..91d2e310 100644 --- a/docs/404.html +++ b/docs/404.html @@ -18,8 +18,8 @@ - - + + @@ -33,8 +33,8 @@ - - + + @@ -70,8 +70,8 @@ - safetyGraphics - 2.0.0 + safetyGraphics + 2.1.0 @@ -84,7 +84,7 @@
  • -app_startup returns the list of charts to safetyGraphicsApp which then then passes them along to safetyGraphicsServer as the charts parameter.
  • +app_startup passes the updated list of charts to makeMeta assuming no meta object was provided. makeMeta combines metadata from all charts in to a single data.frame. Charts can save metadata as chart.meta, {package}::meta_{chart} or {package}::meta_{domain}. +
  • +app_startup returns the list of charts and associated metadata to safetyGraphicsApp which then then passes them along to safetyGraphicsServer as the charts parameter.
  • safetyGraphicsServer then creates modules for each chart. First, UIs are created via chartsNav() which then calls:

    domainData and mapping generally change for every study, while charts and meta can generally be re-used across many studies.

    -

    The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the Chart Configuration Vignette or our 2021 R/Pharma Workshop

    +

    The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the Chart Configuration Vignette or our 2021 R/Pharma Workshop

    @@ -206,7 +206,7 @@

    Custom Charts

    -

    The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this vignette.

    +

    The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this vignette.

    Example 7 - Drop Unwanted Charts

    diff --git a/docs/articles/TechnicalFAQ.html b/docs/articles/TechnicalFAQ.html index 8c47e9c3..d2fd64f1 100644 --- a/docs/articles/TechnicalFAQ.html +++ b/docs/articles/TechnicalFAQ.html @@ -144,7 +144,7 @@

    Q: Is the safetyGraphics app ready for “production” use?

    -

    A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a variety of use cases. The details of a ‘production’ implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians.

    +

    A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a variety of use cases. The details of a ‘production’ implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians.

    That said, the issues surrounding a ‘production’ deployment are mostly technical and operational at this point and could likely be overcome by a motivated organization with ample technical expertise. Some of the issues that would need to be addressed in a production deployment:

    • Qualification documentation (Organization-specific)
    • @@ -153,7 +153,7 @@

    • Data pipeline for study set-up and customization (Organization-specific)
    • Issues with big data set performance in htmlwidget renderers
    -

    Many of these issues aren’t specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. As discussed above, there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible.

    +

    Many of these issues aren’t specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. As discussed above, there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible.

    Finally, it is worth noting “Productionize” and “Validate” are slightly different. Joe Cheng (the primary author of Shiny) has a nice talk on this topic from a software engineering perspective.

    @@ -174,21 +174,21 @@

    Q: Do I have to use a certain data standard with safetyGraphics?

    -

    A: No. Any standard (or non-standard) data can be loaded as long as it meets the minimum data requirements for the selected data domain. Metadata capturing default CDISC standards are included with the app (see ?safetyGraphics::meta) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the cookbook vignette for examples.

    +

    A: No. Any standard (or non-standard) data can be loaded as long as it meets the minimum data requirements for the selected data domain. Metadata capturing default CDISC standards are included with the app (see ?safetyGraphics::meta) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the cookbook vignette for examples.

    Q: What data sources does safetyGraphics support? How do I load custom data?

    -

    A: This topic is covered in detail in the Loading data section of the Introductory vignette. safetyGraphics is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the dataDomains parameter in the safetyGraphicsApp() function or via the safetyGraphicsInit() graphical user interface.

    -

    safetyGraphicsApp() - custom data can be loaded via the dataDomains parameter, which should be a list containing dataframes or tibbles for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or any number of other sources. See the cookbook vignette for some basic examples of loading custom data.

    +

    A: This topic is covered in detail in the Loading data section of the Introductory vignette. safetyGraphics is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the dataDomains parameter in the safetyGraphicsApp() function or via the safetyGraphicsInit() graphical user interface.

    +

    safetyGraphicsApp() - custom data can be loaded via the dataDomains parameter, which should be a list containing dataframes or tibbles for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or any number of other sources. See the cookbook vignette for some basic examples of loading custom data.

    safetyGraphicsInit() - allows users to load tabular data from a variety of sources using the point-and-click interface provided in the {datamods} package.

    -

    More detail is provided in the Loading data section of the Introductory vignette

    +

    More detail is provided in the Loading data section of the Introductory vignette

    Is data loaded in to the safetyGraphics app secure?

    Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package.

    -

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5, 6) - that could help to facilitate these discussion.

    +

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5, 6) - that could help to facilitate these discussion.

    diff --git a/docs/articles/intro.html b/docs/articles/intro.html index 433cad22..88f63ee6 100644 --- a/docs/articles/intro.html +++ b/docs/articles/intro.html @@ -138,7 +138,7 @@

    Charts Tab

    Clicking the Charts tab opens a dropdown menu containing a series of charts related to clinical trial safety. Clicking the Hepatic Safety Explorer opens this page:

    -

    safetyGraphics supports many different kinds of charts including web-based interactive graphics using {htmlwidgets} (like the chart shown above), static plots, plotly plots and custom shiny modules. Each chart has a header that provides details about the chart, links to chart-specific resources and buttons that allow users to download a stand-alone html report or a .R file that reproduces the chart. See the Chart Configuration Vignette for more detail about the safetyGraphics charting framework.

    +

    safetyGraphics supports many different kinds of charts including web-based interactive graphics using {htmlwidgets} (like the chart shown above), static plots, plotly plots and custom shiny modules. Each chart has a header that provides details about the chart, links to chart-specific resources and buttons that allow users to download a stand-alone html report or a .R file that reproduces the chart. See the Chart Configuration Vignette for more detail about the safetyGraphics charting framework.

    @@ -150,7 +150,7 @@

    Loading Study Data

    -

    safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in appendix 2.

    +

    safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in appendix 2.

    There are 2 primary ways to load your study data in to the safetyGraphics shiny app:

    1. Using safetyGraphicsInit() shiny interface
    2. @@ -187,18 +187,18 @@

      ) safetyGraphics::safetyGraphicsApp(domainData=sdtm) -

      This example and other use cases are described in cookbook vignette.

      +

      This example and other use cases are described in cookbook vignette.

    Large Data sets

    -

    Use the maxFileSize option to load data sets larger than 5 mb in safetyGraphicsInit (e.g. safetyGraphicsinit(maxFileSize=100)). safetyGraphicsApp() does not have size limits for data files, but note that large data (>100 mb) may cause performance issues.

    +

    Use the maxFileSize option to load data sets larger than 5 mb in safetyGraphicsInit (e.g. safetyGraphicsinit(maxFileSize=100)). safetyGraphicsApp() does not have size limits for data files, but note that large data (>100 mb) may cause performance issues.

    Additional Resources

    -

    Several additional vignettes are available for more advanced topics: - Chart Configuration Vignette - details about the charting process including technical specifications and step-by-step instructions - Cookbook Vignette - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios - Technical FAQ Vignette - vignette discussing security, validation and other technical issues

    +

    Several additional vignettes are available for more advanced topics: - Chart Configuration Vignette - details about the charting process including technical specifications and step-by-step instructions - Cookbook Vignette - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios - Technical FAQ Vignette - vignette discussing security, validation and other technical issues

    The {safetyGraphics} app is maintained by the Interactive Safety Graphics (ISG) subteam of the ASA Biopharm-DIA Safety Working Group. You can learn more about the team and find links to recent presentations and publications at our home page.

    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 26fa5b13..c28ec7ce 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -6,8 +6,8 @@ articles: TechnicalFAQ: TechnicalFAQ.html chartConfiguration: chartConfiguration.html intro: intro.html -last_built: 2022-03-24T17:17Z +last_built: 2022-03-24T17:41Z urls: - reference: https://safetygraphics.github.io/safetyGraphics//reference - article: https://safetygraphics.github.io/safetyGraphics//articles + reference: https://safetygraphics.github.io/safetyGraphics/reference + article: https://safetygraphics.github.io/safetyGraphics/articles diff --git a/docs/sitemap.xml b/docs/sitemap.xml index aa303cae..0d6376e5 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,168 +1,168 @@ - https://safetygraphics.github.io/safetyGraphics//index.html + https://safetygraphics.github.io/safetyGraphics/index.html - https://safetygraphics.github.io/safetyGraphics//reference/SafetyGraphics.html + https://safetygraphics.github.io/safetyGraphics/reference/SafetyGraphics.html - https://safetygraphics.github.io/safetyGraphics//reference/app_startup.html + https://safetygraphics.github.io/safetyGraphics/reference/app_startup.html - https://safetygraphics.github.io/safetyGraphics//reference/chartsNav.html + https://safetygraphics.github.io/safetyGraphics/reference/chartsNav.html - https://safetygraphics.github.io/safetyGraphics//reference/chartsTab.html + https://safetygraphics.github.io/safetyGraphics/reference/chartsTab.html - https://safetygraphics.github.io/safetyGraphics//reference/chartsTabUI.html + https://safetygraphics.github.io/safetyGraphics/reference/chartsTabUI.html - https://safetygraphics.github.io/safetyGraphics//reference/detectStandard.html + https://safetygraphics.github.io/safetyGraphics/reference/detectStandard.html - https://safetygraphics.github.io/safetyGraphics//reference/evaluateStandard.html + https://safetygraphics.github.io/safetyGraphics/reference/evaluateStandard.html - https://safetygraphics.github.io/safetyGraphics//reference/filterTab.html + https://safetygraphics.github.io/safetyGraphics/reference/filterTab.html - https://safetygraphics.github.io/safetyGraphics//reference/filterTabChecks.html + https://safetygraphics.github.io/safetyGraphics/reference/filterTabChecks.html - https://safetygraphics.github.io/safetyGraphics//reference/filterTabUI.html + https://safetygraphics.github.io/safetyGraphics/reference/filterTabUI.html - https://safetygraphics.github.io/safetyGraphics//reference/generateMappingList.html + https://safetygraphics.github.io/safetyGraphics/reference/generateMappingList.html - https://safetygraphics.github.io/safetyGraphics//reference/hasColumn.html + https://safetygraphics.github.io/safetyGraphics/reference/hasColumn.html - https://safetygraphics.github.io/safetyGraphics//reference/hasField.html + https://safetygraphics.github.io/safetyGraphics/reference/hasField.html - https://safetygraphics.github.io/safetyGraphics//reference/homeTab.html + https://safetygraphics.github.io/safetyGraphics/reference/homeTab.html - https://safetygraphics.github.io/safetyGraphics//reference/homeTabUI.html + https://safetygraphics.github.io/safetyGraphics/reference/homeTabUI.html - https://safetygraphics.github.io/safetyGraphics//reference/loadCharts.html + https://safetygraphics.github.io/safetyGraphics/reference/loadCharts.html - https://safetygraphics.github.io/safetyGraphics//reference/loadChartsUI.html + https://safetygraphics.github.io/safetyGraphics/reference/loadChartsUI.html - https://safetygraphics.github.io/safetyGraphics//reference/loadData.html + https://safetygraphics.github.io/safetyGraphics/reference/loadData.html - https://safetygraphics.github.io/safetyGraphics//reference/loadDataUI.html + https://safetygraphics.github.io/safetyGraphics/reference/loadDataUI.html - https://safetygraphics.github.io/safetyGraphics//reference/makeChartConfig.html + https://safetygraphics.github.io/safetyGraphics/reference/makeChartConfig.html - https://safetygraphics.github.io/safetyGraphics//reference/makeChartExport.html + https://safetygraphics.github.io/safetyGraphics/reference/makeChartExport.html - https://safetygraphics.github.io/safetyGraphics//reference/makeChartParams.html + https://safetygraphics.github.io/safetyGraphics/reference/makeChartParams.html - https://safetygraphics.github.io/safetyGraphics//reference/makeChartSummary.html + https://safetygraphics.github.io/safetyGraphics/reference/makeChartSummary.html - https://safetygraphics.github.io/safetyGraphics//reference/makeMapping.html + https://safetygraphics.github.io/safetyGraphics/reference/makeMapping.html - https://safetygraphics.github.io/safetyGraphics//reference/makeMeta.html + https://safetygraphics.github.io/safetyGraphics/reference/makeMeta.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingColumn.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingColumn.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingColumnUI.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingColumnUI.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingDomain.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingDomain.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingDomainUI.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingDomainUI.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingSelect.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingSelect.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingSelectUI.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingSelectUI.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingTab.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingTab.html - https://safetygraphics.github.io/safetyGraphics//reference/mappingTabUI.html + https://safetygraphics.github.io/safetyGraphics/reference/mappingTabUI.html - https://safetygraphics.github.io/safetyGraphics//reference/prepareChart.html + https://safetygraphics.github.io/safetyGraphics/reference/prepareChart.html - https://safetygraphics.github.io/safetyGraphics//reference/safetyGraphicsApp.html + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsApp.html - https://safetygraphics.github.io/safetyGraphics//reference/safetyGraphicsInit.html + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsInit.html - https://safetygraphics.github.io/safetyGraphics//reference/safetyGraphicsServer.html + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsServer.html - https://safetygraphics.github.io/safetyGraphics//reference/safetyGraphicsUI.html + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsUI.html - https://safetygraphics.github.io/safetyGraphics//reference/setMappingListValue.html + https://safetygraphics.github.io/safetyGraphics/reference/setMappingListValue.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsCharts.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsCharts.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsChartsUI.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsChartsUI.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsCode.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsCode.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsCodeUI.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsCodeUI.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsData.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsData.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsDataUI.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsDataUI.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsMapping.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsMapping.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsMappingUI.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsMappingUI.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsTab.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsTab.html - https://safetygraphics.github.io/safetyGraphics//reference/settingsTabUI.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsTabUI.html - https://safetygraphics.github.io/safetyGraphics//reference/textKeysToList.html + https://safetygraphics.github.io/safetyGraphics/reference/textKeysToList.html - https://safetygraphics.github.io/safetyGraphics//articles/Cookbook.html + https://safetygraphics.github.io/safetyGraphics/articles/Cookbook.html - https://safetygraphics.github.io/safetyGraphics//articles/TechnicalFAQ.html + https://safetygraphics.github.io/safetyGraphics/articles/TechnicalFAQ.html - https://safetygraphics.github.io/safetyGraphics//articles/chartConfiguration.html + https://safetygraphics.github.io/safetyGraphics/articles/chartConfiguration.html - https://safetygraphics.github.io/safetyGraphics//articles/intro.html + https://safetygraphics.github.io/safetyGraphics/articles/intro.html diff --git a/vignettes/Cookbook.Rmd b/vignettes/Cookbook.Rmd index 22278623..34454ce4 100644 --- a/vignettes/Cookbook.Rmd +++ b/vignettes/Cookbook.Rmd @@ -24,7 +24,7 @@ Most of the customization shown here is done by changing 4 key parameters in the `domainData` and `mapping` generally change for every study, while `charts` and `meta` can generally be re-used across many studies. -The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the [Chart Configuration Vignette](ChartConfiguration) or our [2021 R/Pharma Workshop](https://github.com/SafetyGraphics/RPharma2021-Workshop) +The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the [Chart Configuration Vignette](ChartConfiguration.html) or our [2021 R/Pharma Workshop](https://github.com/SafetyGraphics/RPharma2021-Workshop) # Setup and installation @@ -133,7 +133,7 @@ Note, that for more complex customizations, the setting page also provides a `.z # Custom Charts -The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this [vignette](chartConfiguration). +The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this [vignette](chartConfiguration.html). ## Example 7 - Drop Unwanted Charts diff --git a/vignettes/TechnicalFAQ.Rmd b/vignettes/TechnicalFAQ.Rmd index 1c6e4c78..d55a99b1 100644 --- a/vignettes/TechnicalFAQ.Rmd +++ b/vignettes/TechnicalFAQ.Rmd @@ -45,7 +45,7 @@ Whenever new questions come in, we'll update the version of [this FAQ in our wik ## Q: Is the safetyGraphics app ready for "production" use? -A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a [variety of use cases](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ#q-what-are-some-common-use-cases-for-safetygraphics). The details of a 'production' implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians. +A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a [variety of use cases](TechnicalFAQ.html#q-what-are-some-common-use-cases-for-safetygraphics). The details of a 'production' implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians. That said, the issues surrounding a 'production' deployment are mostly technical and operational at this point and could likely be overcome by a motivated organization with ample technical expertise. Some of the issues that would need to be addressed in a production deployment: @@ -55,7 +55,7 @@ That said, the issues surrounding a 'production' deployment are mostly technical - Data pipeline for study set-up and customization (Organization-specific) - Issues with big data set performance in htmlwidget renderers -Many of these issues aren't specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. [As discussed above](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ#q-is-the-safetygraphics-package-validated), there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible. +Many of these issues aren't specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. [As discussed above](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ.html#q-is-the-safetygraphics-package-validated), there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible. Finally, it is worth noting "Productionize” and “Validate” are slightly different. Joe Cheng (the primary author of Shiny) has a [nice talk](https://www.rstudio.com/resources/rstudioconf-2019/shiny-in-production-principles-practices-and-tools/) on this topic from a software engineering perspective. @@ -79,23 +79,23 @@ As an open source tool with a flexible data pipeline, many other use cases have ## Q: Do I have to use a certain data standard with safetyGraphics? -**A**: No. Any standard (or non-standard) data can be loaded as long as it meets the [minimum data requirements](Intro#appendix-2---minimum-data-requirements) for the selected data domain. Metadata capturing default CDISC standards are included with the app (see `?safetyGraphics::meta`) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the [cookbook vignette](cookbook) for examples. +**A**: No. Any standard (or non-standard) data can be loaded as long as it meets the [minimum data requirements](Intro.html#appendix-2---minimum-data-requirements) for the selected data domain. Metadata capturing default CDISC standards are included with the app (see `?safetyGraphics::meta`) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the [cookbook vignette](cookbook) for examples. ## Q: What data sources does safetyGraphics support? How do I load custom data? -**A**: This topic is covered in detail in the [Loading data section of the Introductory vignette](Intro#loading-study-data). `safetyGraphics` is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the `dataDomains` parameter in the `safetyGraphicsApp()` function or via the `safetyGraphicsInit()` graphical user interface. +**A**: This topic is covered in detail in the [Loading data section of the Introductory vignette](Intro.html#loading-study-data). `safetyGraphics` is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the `dataDomains` parameter in the `safetyGraphicsApp()` function or via the `safetyGraphicsInit()` graphical user interface. -`safetyGraphicsApp()` - custom data can be loaded via the `dataDomains` parameter, which should be a list containing `dataframes` or `tibbles` for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or [any number of other sources](https://r4ds.had.co.nz/data-import.html). See the [cookbook vignette](cookbook) for some basic examples of loading custom data. +`safetyGraphicsApp()` - custom data can be loaded via the `dataDomains` parameter, which should be a list containing `dataframes` or `tibbles` for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or [any number of other sources](https://r4ds.had.co.nz/data-import.html). See the [cookbook vignette](cookbook.html) for some basic examples of loading custom data. `safetyGraphicsInit()` - allows users to load tabular data from a variety of sources using the point-and-click interface provided in the {datamods} package. -More detail is provided in the [Loading data section of the Introductory vignette](Intro#loading-study-data) +More detail is provided in the [Loading data section of the Introductory vignette](Intro.html#loading-study-data) ## Is data loaded in to the safetyGraphics app secure? Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package. -Just like the discussion regarding [Validation and Quality Control](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ#validation-quality-control-and-testing), data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general ([1](https://www.hhs.gov/ohrp/sites/default/files/report-privacy-and-health-10-31-19.pdf), [2](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4943495/), [3](https://www.d-wise.com/blog/detailing-the-de-identification-and-data-transparency-boundaries-of-ema-policy-70-and-gdpr)) and discussing data security in shiny ([4](https://www.youtube.com/watch?v=5odJxZj9LE4), +Just like the discussion regarding [Validation and Quality Control](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ.html#validation-quality-control-and-testing), data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general ([1](https://www.hhs.gov/ohrp/sites/default/files/report-privacy-and-health-10-31-19.pdf), [2](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4943495/), [3](https://www.d-wise.com/blog/detailing-the-de-identification-and-data-transparency-boundaries-of-ema-policy-70-and-gdpr)) and discussing data security in shiny ([4](https://www.youtube.com/watch?v=5odJxZj9LE4), [5](https://mastering-shiny.org/scaling-security.html#data), [6](https://support.rstudio.com/hc/en-us/articles/360042593974-R-and-R-Package-Security)) - that could help to facilitate these discussion. ## Q: How can the safetyGraphics app be shared? diff --git a/vignettes/intro.Rmd b/vignettes/intro.Rmd index 613c28fa..33b02bf5 100644 --- a/vignettes/intro.Rmd +++ b/vignettes/intro.Rmd @@ -47,7 +47,7 @@ Clicking the Charts tab opens a dropdown menu containing a series of charts rela -safetyGraphics supports many different kinds of charts including web-based interactive graphics using {htmlwidgets} (like the chart shown above), static plots, plotly plots and custom shiny modules. Each chart has a header that provides details about the chart, links to chart-specific resources and buttons that allow users to download a stand-alone html report or a .R file that reproduces the chart. See the [Chart Configuration Vignette](ChartConfiguration) for more detail about the safetyGraphics charting framework. +safetyGraphics supports many different kinds of charts including web-based interactive graphics using {htmlwidgets} (like the chart shown above), static plots, plotly plots and custom shiny modules. Each chart has a header that provides details about the chart, links to chart-specific resources and buttons that allow users to download a stand-alone html report or a .R file that reproduces the chart. See the [Chart Configuration Vignette](ChartConfiguration.html) for more detail about the safetyGraphics charting framework. ## ⚙️ (Settings) Tab @@ -57,7 +57,7 @@ Finally, the Settings tab - shown as a gear icon ⚙️ - contains technical de # Loading Study Data -safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in [appendix 2](Intro#appendix-2---minimum-data-requirements). +safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in [appendix 2](Intro.html#appendix-2---minimum-data-requirements). There are 2 primary ways to load your study data in to the safetyGraphics shiny app: @@ -99,18 +99,18 @@ sdtm <- list( safetyGraphics::safetyGraphicsApp(domainData=sdtm) ``` -This example and other use cases are described in [cookbook vignette](cookbook). +This example and other use cases are described in [cookbook vignette](Cookbook.html). ## Large Data sets -Use the `maxFileSize` option to load data sets larger than 5 mb in `safetyGraphicsInit` (e.g. `safetyGraphicsinit(maxFileSize=100)`). `safetyGraphicsApp()` does not have size limits for data files, but note that large data (>100 mb) [may cause performance issues](TechnicalFAQ#q-how-do-i-avoid-r-not-choking-on-the-huge-volume-of-lab-data-from-albrechtdurer). +Use the `maxFileSize` option to load data sets larger than 5 mb in `safetyGraphicsInit` (e.g. `safetyGraphicsinit(maxFileSize=100)`). `safetyGraphicsApp()` does not have size limits for data files, but note that large data (>100 mb) [may cause performance issues](TechnicalFAQ.html#q-how-do-i-avoid-r-not-choking-on-the-huge-volume-of-lab-data-from-albrechtdurer). # Additional Resources Several additional vignettes are available for more advanced topics: -- [Chart Configuration Vignette](ChartConfiguration) - details about the charting process including technical specifications and step-by-step instructions -- [Cookbook Vignette](Cookbook) - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios -- [Technical FAQ Vignette](TechnicalFAQ) - vignette discussing security, validation and other technical issues +- [Chart Configuration Vignette](ChartConfiguration.html) - details about the charting process including technical specifications and step-by-step instructions +- [Cookbook Vignette](Cookbook.html) - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios +- [Technical FAQ Vignette](TechnicalFAQ.html) - vignette discussing security, validation and other technical issues The {safetyGraphics} app is maintained by the Interactive Safety Graphics (ISG) subteam of the ASA Biopharm-DIA Safety Working Group. You can learn more about the team and find links to recent presentations and publications at our [home page](https://safetygraphics.github.io/). From 0736adc1d287b1a1a5e6079194b76adbf1f6475e Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 24 Mar 2022 14:29:13 -0400 Subject: [PATCH 36/41] re-run with latest version of pkgdown --- docs/404.html | 129 ++--- docs/LICENSE-text.html | 105 +---- docs/LICENSE.html | 105 +---- docs/articles/Cookbook.html | 401 ++++++++-------- docs/articles/TechnicalFAQ.html | 205 ++++---- docs/articles/chartConfiguration.html | 423 +++++++++-------- docs/articles/index.html | 119 ++--- docs/articles/intro.html | 177 +++---- docs/authors.html | 177 +++---- docs/index.html | 76 +-- docs/news/index.html | 139 ++---- docs/pkgdown.css | 83 ++-- docs/pkgdown.js | 4 +- docs/pkgdown.yml | 4 +- docs/reference/SafetyGraphics.html | 118 +---- docs/reference/app_startup.html | 190 +++----- docs/reference/chartsNav.html | 132 ++---- docs/reference/chartsTab.html | 156 ++----- docs/reference/chartsTabUI.html | 132 ++---- docs/reference/detectStandard.html | 570 ++++++++++------------- docs/reference/evaluateStandard.html | 333 ++++++------- docs/reference/filterTab.html | 191 +++----- docs/reference/filterTabChecks.html | 143 ++---- docs/reference/filterTabUI.html | 126 ++--- docs/reference/generateMappingList.html | 138 ++---- docs/reference/hasColumn.html | 151 ++---- docs/reference/hasField.html | 179 +++---- docs/reference/homeTab.html | 138 ++---- docs/reference/homeTabUI.html | 126 ++--- docs/reference/index.html | 340 +++----------- docs/reference/loadCharts.html | 144 ++---- docs/reference/loadChartsUI.html | 132 ++---- docs/reference/loadData.html | 144 ++---- docs/reference/loadDataUI.html | 132 ++---- docs/reference/makeChartConfig.html | 166 ++----- docs/reference/makeChartExport.html | 137 ++---- docs/reference/makeChartParams.html | 138 ++---- docs/reference/makeChartSummary.html | 138 ++---- docs/reference/makeMapping.html | 156 ++----- docs/reference/makeMeta.html | 173 +++---- docs/reference/mappingColumn.html | 155 ++---- docs/reference/mappingColumnUI.html | 144 ++---- docs/reference/mappingDomain.html | 155 ++---- docs/reference/mappingDomainUI.html | 144 ++---- docs/reference/mappingSelect.html | 143 ++---- docs/reference/mappingSelectUI.html | 149 ++---- docs/reference/mappingTab.html | 155 ++---- docs/reference/mappingTabUI.html | 150 ++---- docs/reference/prepareChart.html | 131 ++---- docs/reference/safetyGraphicsApp.html | 188 +++----- docs/reference/safetyGraphicsInit.html | 146 ++---- docs/reference/safetyGraphicsServer.html | 186 ++------ docs/reference/safetyGraphicsUI.html | 150 ++---- docs/reference/setMappingListValue.html | 172 ++----- docs/reference/settingsCharts.html | 144 ++---- docs/reference/settingsChartsUI.html | 126 ++--- docs/reference/settingsCode.html | 156 ++----- docs/reference/settingsCodeUI.html | 126 ++--- docs/reference/settingsData.html | 144 ++---- docs/reference/settingsDataUI.html | 126 ++--- docs/reference/settingsMapping.html | 150 ++---- docs/reference/settingsMappingUI.html | 126 ++--- docs/reference/settingsTab.html | 162 ++----- docs/reference/settingsTabUI.html | 126 ++--- docs/reference/textKeysToList.html | 183 +++----- docs/sitemap.xml | 115 ++++- vignettes/chartConfiguration.Rmd | 2 + vignettes/intro.Rmd | 2 + 68 files changed, 3302 insertions(+), 7324 deletions(-) diff --git a/docs/404.html b/docs/404.html index 72a39d5c..8da3389f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,66 +1,27 @@ - - - - + + + + - Page not found (404) • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - + - - -
    +
    +
    -
    - +
    + + - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index ac257984..a621d578 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,66 +1,12 @@ - - - - - - - -License • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -License • safetyGraphics - - + + - - -
    -
    - -
    - -
    +
    +
    -
    - +
    - - + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index ad85325c..4d36dbb6 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,66 +1,12 @@ - - - - - - - -MIT License • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -MIT License • safetyGraphics - - + + - - -
    -
    - -
    - -
    +
    +
    -
    - +
    - - + + diff --git a/docs/articles/Cookbook.html b/docs/articles/Cookbook.html index ae29b01e..fe4fe789 100644 --- a/docs/articles/Cookbook.html +++ b/docs/articles/Cookbook.html @@ -19,6 +19,8 @@ + +
    +
    -
    -

    -Cookbook Vignette

    +
    +

    Cookbook Vignette +

    This vignette contains a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios.

    -
    -

    -Overview

    +
    +

    Overview +

    Most of the customization shown here is done by changing 4 key parameters in the safetyGraphicsApp() function:

    • @@ -123,238 +125,235 @@

      meta – Metadata table with info about required columns and fields

    domainData and mapping generally change for every study, while charts and meta can generally be re-used across many studies.

    -

    The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the Chart Configuration Vignette or our 2021 R/Pharma Workshop

    +

    The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the Chart Configuration Vignette or our 2021 R/Pharma Workshop

    -
    -

    -Setup and installation

    +
    +

    Setup and installation +

    safetyGraphics requires R v4 or higher. These examples have been tested using RStudio v1.4, but should work on other platforms with proper configuration.

    -

    You can install safetyGraphics from CRAN like any other R package:

    -
    install.packages("safetyGraphics")
    -library("safetyGraphics")
    +

    You can install safetyGraphics from CRAN like any other R package:

    +
    install.packages("safetyGraphics")
    +library("safetyGraphics")

    Or to use the most recent development version from GitHub, call:

    -
    devtools::install_github("safetyGraphics/safetyCharts", ref="dev")
    -library(safetyCharts)
    -devtools::install_github("safetyGraphics/safetyGraphics", ref="dev")
    -library(safetyGraphics)
    -safetyGraphics::safetyGraphicsApp()
    -
    -

    -Example 1 - Default App

    +
    devtools::install_github("safetyGraphics/safetyCharts", ref="dev")
    +library(safetyCharts)
    +devtools::install_github("safetyGraphics/safetyGraphics", ref="dev")
    +library(safetyGraphics)
    +safetyGraphics::safetyGraphicsApp()
    +
    +

    Example 1 - Default App +

    To run the app with no customizations using sample AdAM data from the {safetyData} package, install the package and run:

    -
    safetyGraphics::safetyGraphicsApp()
    +
    safetyGraphics::safetyGraphicsApp()
    -
    -

    -Loading Custom Data

    +
    +

    Loading Custom Data +

    The next several examples focus on study-specific customizations for loading and mapping data.

    -
    -

    -Example 2 - SDTM Data

    +
    +

    Example 2 - SDTM Data +

    The data passed in to the safetyGraphics app can be customized using the domainData parameter in safetyGraphicsApp(). For example, to run the app with SDTM data saved in {safetyData}, call:

    -
    sdtm <- list(
    -    dm=safetyData::sdtm_dm,
    -    aes=safetyData::sdtm_ae,
    -    labs=safetyData::sdtm_lb
    -)
    +
    sdtm <- list(
    +    dm=safetyData::sdtm_dm,
    +    aes=safetyData::sdtm_ae,
    +    labs=safetyData::sdtm_lb
    +)
     
    -safetyGraphics::safetyGraphicsApp(domainData=sdtm)
    +safetyGraphics::safetyGraphicsApp(domainData=sdtm)
    -
    -

    -Example 3 - Single Data Domain

    +
    +

    Example 3 - Single Data Domain +

    Running the app for a single data domain, is similar:

    -
    justLabs <- list(labs=safetyData::adam_adlbc)
    -safetyGraphics::safetyGraphicsApp(domainData=justLabs)
    +
    justLabs <- list(labs=safetyData::adam_adlbc)
    +safetyGraphics::safetyGraphicsApp(domainData=justLabs)

    Note that charts with missing data are automatically dropped and the filtering tab is not present since it requires demographics data by default.

    -
    -

    -Example 4 - Loading other data formats

    +
    +

    Example 4 - Loading other data formats +

    Users can also import data from a wide-variety of data formats using standard R workflows and then initialize the app. The example below initializes the app using lab data saved as a sas transport file (.xpt)

    -
    xptLabs <- haven::read_xpt('https://github.com/phuse-org/phuse-scripts/blob/master/data/adam/cdiscpilot01/adlbc.xpt?raw=true')
    -safetyGraphics::safetyGraphicsApp(domainData=list(labs=xptLabs))
    +
    xptLabs <- haven::read_xpt('https://github.com/phuse-org/phuse-scripts/blob/master/data/adam/cdiscpilot01/adlbc.xpt?raw=true')
    +safetyGraphics::safetyGraphicsApp(domainData=list(labs=xptLabs))
    -
    -

    -Example 5 - Non-standard data

    +
    +

    Example 5 - Non-standard data +

    Next, let’s initialize the the app with non-standard data. {safetyGraphics} automatically detects AdAM and SDTM data when possible, but for non-standard data, the user must provide a data mapping. This can be done in the app using the data/mapping tab, or can be done when the app is initialized by passing a mapping list to safetyGraphicsApp(). For example:

    -
    notAdAM <- list(labs=safetyData::adam_adlbc %>% rename(id = USUBJID))
    -idMapping<- list(labs=list(id_col="id"))
    -safetyGraphicsApp(domainData=notAdAM, mapping=idMapping)
    +
    notAdAM <- list(labs=safetyData::adam_adlbc %>% rename(id = USUBJID))
    +idMapping<- list(labs=list(id_col="id"))
    +safetyGraphicsApp(domainData=notAdAM, mapping=idMapping)
    -
    -

    -Example 6 - Non-standard data #2

    -

    For a more realistic example, consider this labs data set (csv). The data can be loaded in to safetyGraphics with the code below, but several items in the mapping page need to be filled in:

    -
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    -safetyGraphics::safetyGraphicsApp(domainData=list(labs=labs))
    +
    +

    Example 6 - Non-standard data #2 +

    +

    For a more realistic example, consider this labs data set (csv). The data can be loaded in to safetyGraphics with the code below, but several items in the mapping page need to be filled in:

    +
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    +safetyGraphics::safetyGraphicsApp(domainData=list(labs=labs))

    drawing

    Fortunately there is no need to re-enter this mapping information in every time you re-start the app. After filling in these values once, you can export code to restart the app with the specified settings pre-populated. First, click on the setting icon in the header and then on “code” to see this page:

    The YAML code provided here captures the updates you’ve made on the mapping page. To re-start the app with those settings, just save these YAML code in a new file called customSettings.yaml in your working directory, and then call:

    -
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    -customMapping <- read_yaml("customSettings.yaml")
    -safetyGraphics::safetyGraphicsApp(
    -    domainData=list(labs=labs),
    -    mapping=customMapping   
    -)
    +
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    +customMapping <- read_yaml("customSettings.yaml")
    +safetyGraphics::safetyGraphicsApp(
    +    domainData=list(labs=labs),
    +    mapping=customMapping   
    +)

    Note, that for more complex customizations, the setting page also provides a .zip file with a fully re-usable version of the app.

    -
    -

    -Custom Charts

    +
    +

    Custom Charts +

    The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this vignette.

    -
    -

    -Example 7 - Drop Unwanted Charts

    +
    +

    Example 7 - Drop Unwanted Charts +

    Users can also generate a list of charts and then drop charts that they don’t want to include. For example, if you wanted to drop charts with type of “htmlwidgets” you could run this code.

    -
    library(purrr)
    -charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    -notWidgets <- charts %>% purrr::keep(~.x$type != "htmlwidget")
    -safetyGraphicsApp(charts=notWidgets)
    +
    library(purrr)
    +charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    +notWidgets <- charts %>% purrr::keep(~.x$type != "htmlwidget")
    +safetyGraphicsApp(charts=notWidgets)
    -
    -

    -Example 8 - Edit Default Charts

    +
    +

    Example 8 - Edit Default Charts +

    Users can also make modifications to the default charts by editing the list of charts directly.

    -
    charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    -charts$aeTimelines$label <- "An AMAZING timeline"
    -safetyGraphicsApp(charts=charts)
    +
    charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    +charts$aeTimelines$label <- "An AMAZING timeline"
    +safetyGraphicsApp(charts=charts)
    -
    -

    -Example 9 - Add Hello World Custom Chart

    +
    +

    Example 9 - Add Hello World Custom Chart +

    This example creates a simple “hello world” chart that is not linked to the data or mapping loaded in the app.

    -
    helloWorld <- function(data, settings){
    -    plot(-1:1, -1:1)
    -    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    -}
    +
    helloWorld <- function(data, settings){
    +    plot(-1:1, -1:1)
    +    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    +}
     
    -# Chart Configuration
    -helloworld_chart<-list(
    -    env="safetyGraphics",
    -    name="HelloWorld",
    -    label="Hello World!",
    -    type="plot",
    -    domain="aes",
    -    workflow=list(
    -        main="helloWorld"
    -    )
    -)
    +# Chart Configuration
    +helloworld_chart<-list(
    +    env="safetyGraphics",
    +    name="HelloWorld",
    +    label="Hello World!",
    +    type="plot",
    +    domain="aes",
    +    workflow=list(
    +        main="helloWorld"
    +    )
    +)
     
    -safetyGraphicsApp(charts=list(helloworld_chart))
    +safetyGraphicsApp(charts=list(helloworld_chart))
    -
    -

    -Example 10 - Add a custom chart using data and settings

    +
    +

    Example 10 - Add a custom chart using data and settings +

    The code below adds a new simple chart showing participants’ age distribution by sex.

    -
    ageDist <- function(data, settings){
    -    p<-ggplot(data = data, aes(x=.data[[settings$age_col]])) +
    -        geom_histogram() + 
    -        facet_wrap(settings$sex_col)
    -    return(p)
    -}
    +
    ageDist <- function(data, settings){
    +    p<-ggplot(data = data, aes(x=.data[[settings$age_col]])) +
    +        geom_histogram() + 
    +        facet_wrap(settings$sex_col)
    +    return(p)
    +}
     
    -ageDist_chart<-list(
    -    env="safetyGraphics",
    -    name="ageDist",
    -    label="Age Distribution",
    -    type="plot",
    -    domain="dm",
    -    workflow=list(
    -        main="ageDist"
    -    )
    -)
    -charts <- makeChartConfig() 
    -charts$ageDist<-ageDist_chart
    -safetyGraphicsApp(charts=charts)
    +ageDist_chart<-list( + env="safetyGraphics", + name="ageDist", + label="Age Distribution", + type="plot", + domain="dm", + workflow=list( + main="ageDist" + ) +) +charts <- makeChartConfig() +charts$ageDist<-ageDist_chart +safetyGraphicsApp(charts=charts)
    -
    -

    -Example 11 - Create a Hello World Data Domain and Chart

    +
    +

    Example 11 - Create a Hello World Data Domain and Chart +

    Here we extend example 9 to include the creating of a new data domain with custom metadata, which is bound to the chart object as chart$meta. See ?makeMeta for more detail about the creation of custom metadata.

    -
    
    -helloMeta <- tribble(
    -    ~text_key, ~domain, ~label,       ~standard_hello, ~description,
    -    "x_col",   "hello", "x position", "x",             "x position for points in hello world chart",   
    -    "y_col",   "hello", "y position", "y",             "y position for points in hello world chart"   
    -) %>% mutate(
    -    col_key = text_key,
    -    type="column"
    -)
    +
    helloMeta <- tribble(
    +    ~text_key, ~domain, ~label,       ~standard_hello, ~description,
    +    "x_col",   "hello", "x position", "x",             "x position for points in hello world chart",   
    +    "y_col",   "hello", "y position", "y",             "y position for points in hello world chart"   
    +) %>% mutate(
    +    col_key = text_key,
    +    type="column"
    +)
     
    -helloData<-data.frame(x=runif(50, -1,1), y=runif(50, -1,1))
    +helloData<-data.frame(x=runif(50, -1,1), y=runif(50, -1,1))
     
    -helloWorld <- function(data, settings){
    -    plot(-1:1, -1:1)
    -    text(data[[settings$x_col]], data[[settings$y_col]], "Custom Hello Domain!")
    -}
    +helloWorld <- function(data, settings){
    +    plot(-1:1, -1:1)
    +    text(data[[settings$x_col]], data[[settings$y_col]], "Custom Hello Domain!")
    +}
     
    -helloChart<-prepareChart(
    -    list(
    -        env="safetyGraphics",
    -        name="HelloWorld",
    -        label="Hello World!",
    -        type="plot",
    -        domain="hello",
    -        workflow=list(
    -            main="helloWorld"
    -        ), 
    -        meta=helloMeta
    -    )
    -)
    +helloChart<-prepareChart(
    +    list(
    +        env="safetyGraphics",
    +        name="HelloWorld",
    +        label="Hello World!",
    +        type="plot",
    +        domain="hello",
    +        workflow=list(
    +            main="helloWorld"
    +        ), 
    +        meta=helloMeta
    +    )
    +)
     
    -charts <- makeChartConfig()
    -charts$hello <- helloChart #Easy to combine default and custom charts
    -data<-list(
    -    labs=safetyData::adam_adlbc, 
    -    aes=safetyData::adam_adae, 
    -    dm=safetyData::adam_adsl,
    -    hello=helloData
    -)
    +charts <- makeChartConfig()
    +charts$hello <- helloChart #Easy to combine default and custom charts
    +data<-list(
    +    labs=safetyData::adam_adlbc, 
    +    aes=safetyData::adam_adae, 
    +    dm=safetyData::adam_adsl,
    +    hello=helloData
    +)
     
    -#no need to specify meta since safetyGraphics::makeMeta() will generate the correct list by default. 
    -safetyGraphicsApp(
    -    domainData=data, 
    -    charts=charts
    -)
    +#no need to specify meta since safetyGraphics::makeMeta() will generate the correct list by default. +safetyGraphicsApp( + domainData=data, + charts=charts +)
    -
    -

    -Example 13 - Create an ECG Data Domain & Chart

    -

    This example defines a custom ECG data domain and adapts an existing chart for usage there. See this PR for a full implementation of the ECG domain in safetyCharts.

    -
    
    -adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
    +
    +

    Example 13 - Create an ECG Data Domain & Chart +

    +

    This example defines a custom ECG data domain and adapts an existing chart for usage there. See this PR for a full implementation of the ECG domain in safetyCharts.

    +
    adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
     
    -ecg_meta <-tibble::tribble(
    -    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    -    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    -    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    -    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    -"studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    -    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    -    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    -    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    -    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    -) %>% mutate(
    -    col_key = text_key,
    -    type="column"
    -)
    +ecg_meta <-tibble::tribble(
    +    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    +    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    +    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    +    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    +"studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    +    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    +    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    +    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    +    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    +) %>% mutate(
    +    col_key = text_key,
    +    type="column"
    +)
     
    -qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    -qtOutliers$label <- "QT Outlier explorer"
    -qtOutliers$domain <- "custom_ecg"
    -qtOutliers$meta <- ecg_meta
    +qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    +qtOutliers$label <- "QT Outlier explorer"
    +qtOutliers$domain <- "custom_ecg"
    +qtOutliers$meta <- ecg_meta
     
    -safetyGraphicsApp(
    -    meta=ecg_meta, 
    -    domainData=list(custom_ecg=adeg), 
    -    charts=list(qtOutliers)
    -)
    -
    +safetyGraphicsApp( + meta=ecg_meta, + domainData=list(custom_ecg=adeg), + charts=list(qtOutliers) +)
    @@ -370,11 +369,13 @@

    -

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.2.

    @@ -383,5 +384,7 @@

    + + diff --git a/docs/articles/TechnicalFAQ.html b/docs/articles/TechnicalFAQ.html index d2fd64f1..0143e58a 100644 --- a/docs/articles/TechnicalFAQ.html +++ b/docs/articles/TechnicalFAQ.html @@ -19,6 +19,8 @@ + +
    +
    -
    -

    -Technical FAQ Vignette

    +
    +

    Technical FAQ Vignette +

    This vignette answers frequently asked technical questions about {safetyGraphics}. It addressees questions on a variety of technical topics including Qualification and Validation status, Common Data Pipelines and Security.

    -

    Whenever new questions come in, we’ll update the version of this FAQ in our wiki - so check there first if you have a question. We’ll update the vignette on CRAN whenever a new version of the package is released.

    -
    -
    -

    -Contributing

    -
    -

    -Q: Can I contribute code to the project?

    -

    A: Yes. Check out our contributor guidelines. Feel free to follow-up with questions on the discussion board.

    -
    -
    -

    -Q: Can I join the working group?

    -

    A: Yes. Fill out this Google Form and we’ll get in touch.

    -
    -
    -
    -

    -Validation, Quality Control and Testing

    -
    -

    -Q: Is the safetyGraphics package validated?

    -

    A: As of the version 2 release, the safetyGraphics package is intended for exploratory use only and is not validated or qualified per 21 CFR Part 11. No warranty or guarantees are included as part of the package. Further, any formal validation should be fit for purpose and follow your organization’s procedures. That said, extensive quality checks are built in to the package (see the question below for details) and into many of charts that are included by default. The R Consortium has guidance on usage of R in Regulated Trials and we also follow the work of R Validation hub closely, and may release validation guidance based on the approach described in their white paper at a future date.

    -
    -
    -

    -Q: Can I validate charts created by safetyGraphics?

    +

    Whenever new questions come in, we’ll update the version of this FAQ in our wiki - so check there first if you have a question. We’ll update the vignette on CRAN whenever a new version of the package is released.

    +
    +
    +

    Contributing +

    +
    +

    Q: Can I contribute code to the project? +

    +

    A: Yes. Check out our contributor guidelines. Feel free to follow-up with questions on the discussion board.

    +
    +
    +

    Q: Can I join the working group? +

    +

    A: Yes. Fill out this Google Form and we’ll get in touch.

    +
    +
    +
    +

    Validation, Quality Control and Testing +

    +
    +

    Q: Is the safetyGraphics package validated? +

    +

    A: As of the version 2 release, the safetyGraphics package is intended for exploratory use only and is not validated or qualified per 21 CFR Part 11. No warranty or guarantees are included as part of the package. Further, any formal validation should be fit for purpose and follow your organization’s procedures. That said, extensive quality checks are built in to the package (see the question below for details) and into many of charts that are included by default. The R Consortium has guidance on usage of R in Regulated Trials and we also follow the work of R Validation hub closely, and may release validation guidance based on the approach described in their white paper at a future date.

    +
    +
    +

    Q: Can I validate charts created by safetyGraphics? +

    A: Study-specific instances of most safetyGraphics charts can be exported either as an R script or as a standalone html report. It may be possible to treat those outputs as standard TLFs (Tables, Listings and Figures) and conduct QC/Validation on them using standard statistical SOPs. Consult with your companies procedures to confirm.

    -
    -

    -Q: What testing/QC process for safetyGraphics?

    -

    A: Several layers of quality control are included in our standard development workflow including: - Over 200 automated unit tests with testthat that run automatically via Continuous integration with GitHub actions. - Automated unit tests for shiny modules run via a headless browser using shinytest. - Pass all standard R checks in R cmd check - Full code review of all new functionality documented in GitHub PR. - Issue tracking in GitHub - Formal Alpha/Beta user testing before major releases - Basic user tests conducted before minor release

    +
    +

    Q: What testing/QC process for safetyGraphics? +

    +

    A: Several layers of quality control are included in our standard development workflow including: - Over 200 automated unit tests with testthat that run automatically via Continuous integration with GitHub actions. - Automated unit tests for shiny modules run via a headless browser using shinytest. - Pass all standard R checks in R cmd check - Full code review of all new functionality documented in GitHub PR. - Issue tracking in GitHub - Formal Alpha/Beta user testing before major releases - Basic user tests conducted before minor release

    -
    -

    -Q: Is the safetyGraphics app ready for “production” use?

    +
    +

    Q: Is the safetyGraphics app ready for “production” use? +

    A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a variety of use cases. The details of a ‘production’ implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians.

    That said, the issues surrounding a ‘production’ deployment are mostly technical and operational at this point and could likely be overcome by a motivated organization with ample technical expertise. Some of the issues that would need to be addressed in a production deployment:

      @@ -153,73 +155,74 @@

    • Data pipeline for study set-up and customization (Organization-specific)
    • Issues with big data set performance in htmlwidget renderers
    -

    Many of these issues aren’t specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. As discussed above, there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible.

    -

    Finally, it is worth noting “Productionize” and “Validate” are slightly different. Joe Cheng (the primary author of Shiny) has a nice talk on this topic from a software engineering perspective.

    +

    Many of these issues aren’t specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. As discussed above, there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible.

    +

    Finally, it is worth noting “Productionize” and “Validate” are slightly different. Joe Cheng (the primary author of Shiny) has a nice talk on this topic from a software engineering perspective.

    -
    -

    -Use Cases, Data Sources and Deployment

    -
    -

    -Q: I can see that the software has the MIT license, so does this essentially mean that any company would be free to use the software without restriction?

    -

    A: Yes. The package is open source and free to use. Here’s a link to the license and a quick summary of how it works.

    +
    +

    Use Cases, Data Sources and Deployment +

    +
    +

    Q: I can see that the software has the MIT license, so does this essentially mean that any company would be free to use the software without restriction? +

    +

    A: Yes. The package is open source and free to use. Here’s a link to the license and a quick summary of how it works.

    -
    -

    -Q: What are some common use cases for safetyGraphics?

    +
    +

    Q: What are some common use cases for safetyGraphics? +

    A: safetyGraphics graphics has been used in a variety of ways. Some of the most common use cases thus far are: - Analysts exploring safety data - Clinicians monitoring ongoing studies - Analysts and Clinicians evaluating safety signals in completed studies

    -

    As an open source tool with a flexible data pipeline, many other use cases have been discussed: - Data review by Data Safety Monitoring Boards (link) - Visualizing Analysis results data (link) - Risk based monitoring

    +

    As an open source tool with a flexible data pipeline, many other use cases have been discussed: - Data review by Data Safety Monitoring Boards (link) - Visualizing Analysis results data (link) - Risk based monitoring

    -
    -

    -Q: Do I have to use a certain data standard with safetyGraphics?

    +
    +

    Q: Do I have to use a certain data standard with safetyGraphics? +

    A: No. Any standard (or non-standard) data can be loaded as long as it meets the minimum data requirements for the selected data domain. Metadata capturing default CDISC standards are included with the app (see ?safetyGraphics::meta) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the cookbook vignette for examples.

    -
    -

    -Q: What data sources does safetyGraphics support? How do I load custom data?

    +
    +

    Q: What data sources does safetyGraphics support? How do I load custom data? +

    A: This topic is covered in detail in the Loading data section of the Introductory vignette. safetyGraphics is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the dataDomains parameter in the safetyGraphicsApp() function or via the safetyGraphicsInit() graphical user interface.

    -

    safetyGraphicsApp() - custom data can be loaded via the dataDomains parameter, which should be a list containing dataframes or tibbles for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or any number of other sources. See the cookbook vignette for some basic examples of loading custom data.

    +

    safetyGraphicsApp() - custom data can be loaded via the dataDomains parameter, which should be a list containing dataframes or tibbles for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or any number of other sources. See the cookbook vignette for some basic examples of loading custom data.

    safetyGraphicsInit() - allows users to load tabular data from a variety of sources using the point-and-click interface provided in the {datamods} package.

    More detail is provided in the Loading data section of the Introductory vignette

    -
    -

    -Is data loaded in to the safetyGraphics app secure?

    +
    +

    Is data loaded in to the safetyGraphics app secure? +

    Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package.

    -

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5, 6) - that could help to facilitate these discussion.

    -
    -
    -

    -Q: How can the safetyGraphics app be shared?

    -

    A: The safetyGraphics app can be shared using standard shiny methodology. More details for specific use cases are given in the next few questions. Charts created by safetyGraphics can also be exported and re-used. Charts created with htmlwidgets are especially flexible and can be used in many contexts - including in web applications outside of R.

    -
    -
    -

    -Q: Do you recommend deploying the app to a dedicated server for internal usage?

    -

    A: It depends a bit on your use-case and how the app is hosted. For example, analysts using the data in an exploratory fashion can probably just run it from RStudio, but if multiple medical monitors using the app for medical monitoring in active studies probably need a more robust (and possibly validated) set up using Shiny Server, RStudio Connect or something similar.

    -
    -
    -

    -Q: Can I deploy safetyGraphics to shinyapps.io to explore trial data from my organization?

    -

    A: We advise against loading non-authorized, private, or non-deidentified patient data outside of your organization’s firewall. Consult with your IT and QA first. There is huge risk associated with confidentiality, IP, and patient privacy. Also refer to ShinyApps.io Chapter 8 Security and Compliance.

    -
    -
    -

    -Q: Can I deploy safetyGraphics to an internal RStudio Connect server?

    -

    A: Yes. The script below should be easy to deploy via the RStudio interface or by running rsconnect::deployApp() and can easily be customized to support custom data and charts.

    -
    # Launch the ShinyApp (Do not remove this comment)
    -library(safetyGraphics) 
    -safetyGraphics::safetyGraphicsApp(runNow = FALSE) 
    -
    -
    -
    -

    -Misc.

    -
    -

    -Q: How do I avoid R not choking on the huge volume of lab data? (from @AlbrechtDurer)

    +

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5, 6) - that could help to facilitate these discussion.

    +
    +
    +

    Q: How can the safetyGraphics app be shared? +

    +

    A: The safetyGraphics app can be shared using standard shiny methodology. More details for specific use cases are given in the next few questions. Charts created by safetyGraphics can also be exported and re-used. Charts created with htmlwidgets are especially flexible and can be used in many contexts - including in web applications outside of R.

    +
    +
    +

    Q: Do you recommend deploying the app to a dedicated server for internal usage? +

    +

    A: It depends a bit on your use-case and how the app is hosted. For example, analysts using the data in an exploratory fashion can probably just run it from RStudio, but if multiple medical monitors using the app for medical monitoring in active studies probably need a more robust (and possibly validated) set up using Shiny Server, RStudio Connect or something similar.

    +
    +
    +

    Q: Can I deploy safetyGraphics to shinyapps.io to explore trial data from my organization? +

    +

    A: We advise against loading non-authorized, private, or non-deidentified patient data outside of your organization’s firewall. Consult with your IT and QA first. There is huge risk associated with confidentiality, IP, and patient privacy. Also refer to ShinyApps.io Chapter 8 Security and Compliance.

    +
    +
    +

    +Q: Can I deploy safetyGraphics to an internal RStudio Connect server? +

    +

    A: Yes. The script below should be easy to deploy via the RStudio interface or by running rsconnect::deployApp() and can easily be customized to support custom data and charts.

    +
    # Launch the ShinyApp (Do not remove this comment)
    +library(safetyGraphics) 
    +safetyGraphics::safetyGraphicsApp(runNow = FALSE)
    +
    +
    +
    +

    Misc. +

    +
    +

    Q: How do I avoid R not choking on the huge volume of lab data? (from @AlbrechtDurer) +

    A: Several of the JavaScript charts build using htmlwidgets do have performance issues with very large data sets. Focusing on specific toxicities helps, but probably isn’t enough for really big studies. In those cases, I think the most important thing is to design a your data pipeline to include both a database backend (as opposed to loading all of your study data each time you initialize the app) and visualizations that summarize the data in a reasonable way (as opposed to just plotting every single data point in a scatter plot no matter what). Fortunately this is all doable in R, and improvements in this area are on our road map for future releases of safetyGraphics.

    @@ -236,11 +239,13 @@

    -

    Site built with pkgdown 1.6.1.

    +

    +

    Site built with pkgdown 2.0.2.

    @@ -249,5 +254,7 @@

    + + diff --git a/docs/articles/chartConfiguration.html b/docs/articles/chartConfiguration.html index fce96bd5..46bd3c10 100644 --- a/docs/articles/chartConfiguration.html +++ b/docs/articles/chartConfiguration.html @@ -19,6 +19,8 @@ + +
    +
    -
    -

    -Chart Configuration Vignette

    +
    +

    Chart Configuration Vignette +

    The {safetyGraphics} shiny app can be used to display a wide variety of charts. This vignette provides details about the charting process including step-by-step instructions for adding new charts and technical specifications, but first we need to talk about a 2nd package …

    -
    -

    -Introducing {safetyCharts}

    +
    +

    Introducing {safetyCharts} +

    While this is technically a vignette for {safetyGraphics}, the {safetyCharts} package is just as important here. The roles of the packages can be summarized in just a few words:

    The {safetyGraphics} platform displays charts from {safetyCharts}.

    This relationship is central to the technical framework for the safetyGraphics app. By itself, the safetyGraphics platform really doesn’t do much! In fact, none of the content on the Charts tab is actually found in the safetyGraphics package; it’s all imported from elsewhere! As you’ve probably guessed, the default charts live in the safetyCharts package. safetyCharts has over a dozen charts that are configured to work with {safetyGraphics}, but can also easily be used independently.

    While {safetyGraphics} and {safetyCharts} are designed to work seamlessly together, users can also add charts from other packages. In fact, several charts in {safetyCharts} are just wrappers that load charts from other packages for use in {safetyGraphics}. The rest of this vignette provides a series of step-by-step examples detailing how this process works for different types of charts.

    -
    -

    -{safetyGraphics} Chart Components

    +
    +

    {safetyGraphics} Chart Components +

    To add a chart to safetyGraphics, two components are required:

    1. A Configuration Object
    2. A Chart Function
    -

    The configuration file captures metadata about the chart for use in the app and is typically saved as a YAML file. Several example configuration files are provided in the examples below, and YAML Configuration files for {safetyCharts} are saved here.

    +

    The configuration file captures metadata about the chart for use in the app and is typically saved as a YAML file. Several example configuration files are provided in the examples below, and YAML Configuration files for {safetyCharts} are saved here.

    The chart function typically takes a list of settings and a list of data as inputs and returns a chart object ready to be displayed in the app. Details of charting functions vary somewhat for different chart types, as explained in the examples below.

    A full technical specification of this chart configuration framework is provided in Appendix 1.

    -
    -

    -Example 1 - Hello World

    +
    +

    Example 1 - Hello World +

    Once you’ve created the configuration and chart functions, the chart can be added to the app via the charts parameter in safetyGraphicsApp(). Consider this simple “Hello World” example:

    -
    # Chart Function
    -helloWorld <- function(data, settings){
    -    plot(-1:1, -1:1)
    -    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    -}
    +
    # Chart Function
    +helloWorld <- function(data, settings){
    +    plot(-1:1, -1:1)
    +    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    +}
     
    -# Chart Configuration
    -helloworld_chart<-list(
    -    env="safetyGraphics",
    -    name="HelloWorld",
    -    label="Hello World!",
    -    type="plot",
    -    domain="aes",
    -    workflow=list(
    -        main="helloWorld"
    -    )
    -)
    +# Chart Configuration
    +helloworld_chart<-list(
    +    env="safetyGraphics",
    +    name="HelloWorld",
    +    label="Hello World!",
    +    type="plot",
    +    domain="aes",
    +    workflow=list(
    +        main="helloWorld"
    +    )
    +)
     
    -safetyGraphicsApp(charts=list(helloworld_chart))
    +safetyGraphicsApp(charts=list(helloworld_chart))

    It’s also easy to add a custom chart to the default charts provided in {safetyCharts} using the makeChartConfig() function:

    -
    charts <- makeChartConfig(packages="safetyCharts") # or just makeChartConfig() since safetyCharts is included by default
    -charts$helloworld<-helloworld_chart
    -safetyGraphicsApp(charts=charts)
    +
    charts <- makeChartConfig(packages="safetyCharts") # or just makeChartConfig() since safetyCharts is included by default
    +charts$helloworld<-helloworld_chart
    +safetyGraphicsApp(charts=charts)

    Here’s our Hello World the chart running in the app:

    -
    -

    -Example 2 - Static Outlier Explorer

    +
    +

    Example 2 - Static Outlier Explorer +

    Now let’s consider a more complex example that makes use of the data and settings provided in safetyGraphics. In this section, we use {ggplot2} to create a spaghetti plot for tracking outliers in lab data. First, consider the following code which creates a stand-alone plot for a single data set:

    -
    # Use sample clinical trial data sets from the {safetyData} package
    -library(safetyData) 
    -library(ggplot2)
    -library(dplyr)
    +
    # Use sample clinical trial data sets from the {safetyData} package
    +library(safetyData) 
    +library(ggplot2)
    +library(dplyr)
     
    -# Define data mapping using a format similar to a reactive safetyGraphics mapping 
    -settings <- list(
    -    id_col="USUBJID",
    -    value_col="LBSTRESN",
    -    measure_col="LBTEST",
    -    studyday_col="LBDY"
    -)
    +# Define data mapping using a format similar to a reactive safetyGraphics mapping 
    +settings <- list(
    +    id_col="USUBJID",
    +    value_col="LBSTRESN",
    +    measure_col="LBTEST",
    +    studyday_col="LBDY"
    +)
     
    -# Define a plotting function that takes data and settings as inputs 
    -spaghettiPlot <- function( data, settings ){
    -    # define plot aes - note use of standard evaluation! 
    -    plot_aes <- aes(
    -        x=.data[[settings$studyday_col]], 
    -        y=.data[[settings$value_col]], 
    -        group=.data[[settings$id_col]]
    -    )
    +# Define a plotting function that takes data and settings as inputs 
    +spaghettiPlot <- function( data, settings ){
    +    # define plot aes - note use of standard evaluation! 
    +    plot_aes <- aes(
    +        x=.data[[settings$studyday_col]], 
    +        y=.data[[settings$value_col]], 
    +        group=.data[[settings$id_col]]
    +    )
     
    -    #create the plot
    -    p<-ggplot(data = data, plot_aes) +
    -        geom_path(alpha=0.15) + 
    -        facet_wrap(
    -            settings$measure_col,
    -            scales="free_y"
    -        )
    -    return(p)
    -}
    +    #create the plot
    +    p<-ggplot(data = data, plot_aes) +
    +        geom_path(alpha=0.15) + 
    +        facet_wrap(
    +            settings$measure_col,
    +            scales="free_y"
    +        )
    +    return(p)
    +}
     
    -spaghettiPlot(
    -    safetyData::sdtm_lb %>% 
    -        filter(LBTEST %in% c("Albumin","Bilirubin","Calcium","Chloride")), 
    -    settings
    -)
    +spaghettiPlot( + safetyData::sdtm_lb %>% + filter(LBTEST %in% c("Albumin","Bilirubin","Calcium","Chloride")), + settings +)

    Running the code above should create a plot with 4 panels:

    -

    With minor modifications, this chart can be added to the {safetyGraphics} shiny app, which allows us to create the chart with any mappings/data combination loaded in the app. The spaghettiPlot() function above is already written to work with safetyGraphics, so we just need to create the chart configuration object. This time we’ll capture the configuration in a YAML file.

    +

    With minor modifications, this chart can be added to the {safetyGraphics} shiny app, which allows us to create the chart with any mappings/data combination loaded in the app. The spaghettiPlot() function above is already written to work with safetyGraphics, so we just need to create the chart configuration object. This time we’ll capture the configuration in a YAML file.

    env: safetyGraphics
     label: Spaghetti Plot
     name: spaghettiPlot
    @@ -213,10 +215,10 @@ 

    links: safetyCharts: https://github.com/SafetyGraphics/safetycharts

    With the charting function loaded in to our session and the configuration file saved in our working directory as spaghetti.yaml, we can add the chart to the app as follows:

    -
    library(yaml)
    -charts <- makeChartConfig()
    -charts$spaghetti<-prepareChart(read_yaml('spaghetti.yaml'))
    -safetyGraphicsApp(charts=charts)
    +
    library(yaml)
    +charts <- makeChartConfig()
    +charts$spaghetti<-prepareChart(read_yaml('spaghetti.yaml'))
    +safetyGraphicsApp(charts=charts)

    Under the charts tab, you’ll see:

    If you look closely at the spaghettiPlot() code above, you’ll noticed some details that make the chart work in the app:

    @@ -226,68 +228,68 @@

  • The spaghettiPlot function is referenced in the main item the YAML workflow. This tells the app which function to use to draw the chart.
  • We’re using the .data[[]] pronoun in the chart function to access columns in the data based on the current settings. See these references for a lot more detail about functional programming in the tidyverse:
  • -

    This example is inspired by safetyCharts::safety_outlier_explorer - the charting function and yaml configuration file on are GitHub.

    +

    This example is inspired by safetyCharts::safety_outlier_explorer - the charting function and yaml configuration file on are GitHub.

    -
    -

    -Example 3 - Shiny Module

    -

    {safetyGraphics} also supports defining charts as Shiny Modules. Once you’re familiar with modules, they are relatively straightforward to use with safetyGraphics.

    -

    Let’s take a look at a simple module that extends the functionality of the static chart from the example above. Once again, this example is based upon safetyCharts, and you can see the code and config on GitHub.

    +
    +

    Example 3 - Shiny Module +

    +

    {safetyGraphics} also supports defining charts as Shiny Modules. Once you’re familiar with modules, they are relatively straightforward to use with safetyGraphics.

    +

    Let’s take a look at a simple module that extends the functionality of the static chart from the example above. Once again, this example is based upon safetyCharts, and you can see the code and config on GitHub.

    The config object for a module differs from a static chart is that the workflow section of the YAML file must specify ui and server functions instead of a main charting function. This example defines a simple UI function that allows users to select which lab measurements should be included in the spaghetti plot from example 1:

    -
    safetyOutlierExplorer_ui <- function(id) {
    -    ns <- NS(id) 
    -    sidebar<-sidebarPanel(
    -        selectizeInput(
    -            ns("measures"), 
    -            "Select Measures", 
    -            multiple=TRUE, 
    -            choices=c("")
    -        )
    -    )
    -    main<-mainPanel(plotOutput(ns("outlierExplorer")))
    -    ui<-fluidPage(
    -        sidebarLayout(
    -            sidebar,
    -            main,
    -            position = c("right"),
    -            fluid=TRUE
    -        )
    -    )
    -    return(ui)
    -}
    -

    Next we define a server function that populates the control for selecting measurements and then draws the plot using safetyCharts::safety_outlier_explorer() charting function - which is based on the spaghetti() function! Note that the server function takes a single reactive params object containing the data (params$data) and settings (param$settings) as input.

    -
    safetyOutlierExplorer_server <- function(input, output, session, params) {
    +
    safetyOutlierExplorer_ui <- function(id) {
    +    ns <- NS(id) 
    +    sidebar<-sidebarPanel(
    +        selectizeInput(
    +            ns("measures"), 
    +            "Select Measures", 
    +            multiple=TRUE, 
    +            choices=c("")
    +        )
    +    )
    +    main<-mainPanel(plotOutput(ns("outlierExplorer")))
    +    ui<-fluidPage(
    +        sidebarLayout(
    +            sidebar,
    +            main,
    +            position = c("right"),
    +            fluid=TRUE
    +        )
    +    )
    +    return(ui)
    +}
    +

    Next we define a server function that populates the control for selecting measurements and then draws the plot using safetyCharts::safety_outlier_explorer() charting function - which is based on the spaghetti() function! Note that the server function takes a single reactive params object containing the data (params$data) and settings (param$settings) as input.

    +
    safetyOutlierExplorer_server <- function(input, output, session, params) {
     
    -    ns <- session$ns
    -    # Populate control with measures and select all by default
    -    observe({
    -        measure_col <- params()$settings$measure_col
    -        measures <- unique(params()$data[[measure_col]])
    -        updateSelectizeInput(
    -            session, 
    -            "measures",
    -            choices = measures,
    -            selected = measures
    -        )
    -    })
    +    ns <- session$ns
    +    # Populate control with measures and select all by default
    +    observe({
    +        measure_col <- params()$settings$measure_col
    +        measures <- unique(params()$data[[measure_col]])
    +        updateSelectizeInput(
    +            session, 
    +            "measures",
    +            choices = measures,
    +            selected = measures
    +        )
    +    })
     
    -    # customize selected measures based on input
    -    settingsR <- reactive({
    -        settings <- params()$settings
    -        settings$measure_values <- input$measures
    -        return(settings)
    -    })
    +    # customize selected measures based on input
    +    settingsR <- reactive({
    +        settings <- params()$settings
    +        settings$measure_values <- input$measures
    +        return(settings)
    +    })
     
    -    #draw the chart
    -    output$outlierExplorer <- renderPlot({safety_outlier_explorer(params()$data, settingsR())})
    -}
    + #draw the chart + output$outlierExplorer <- renderPlot({safety_outlier_explorer(params()$data, settingsR())}) +}

    Finally, the YAML configuration file looks like this - just the workflow and label changes from Example 1:

    env: safetyGraphics
     label: Outlier Explorer - Module
    @@ -304,23 +306,23 @@ 

    Initializing the app as usual by adding it to the chart list: charts$outlierMod<-prepareChart(read_yaml('outlierMod.yaml'))

    Unselecting a few measures gives the following display:

    -
    -

    -Example 4 - htmlwidgets and init functions

    -

    You can also add custom htmlwidgets to safetyGraphics. In fact, many of the default charts imported from safetyCharts are javascript libraries that are imported as htmlwidgets. Like shiny modules, htmlwidgets are relatively simple to use once you are familiar with the basics.

    +
    +

    Example 4 - htmlwidgets and init functions +

    +

    You can also add custom htmlwidgets to safetyGraphics. In fact, many of the default charts imported from safetyCharts are javascript libraries that are imported as htmlwidgets. Like shiny modules, htmlwidgets are relatively simple to use once you are familiar with the basics.

    The biggest differences between widgets and other charts in safetyGraphics are:

    1. The widget must be contained in a package, which must be specified in the YAML file.
    2. The widget expects a widget item giving the name of the widget in the YAML workflow.
    3. -
    4. By default, the data and settings for a widget are passed in a list (list(data=data, settings=settings)) to the x parameter in htmlwidget::createWidget.
    5. +
    6. By default, the data and settings for a widget are passed in a list (list(data=data, settings=settings)) to the x parameter in htmlwidget::createWidget.

    Items 1 and 2 above are simple enough, but #3 is likely to create problems unless the widget is designed specifically for usage with safetyGraphics. That is, if the widget isn’t expecting x$settings to be a list that it uses to configure the chart, it probably isn’t going to work as expected.

    -

    Fortunately, there’s a workaround built in to safetyGraphics in the form of init workflow functions. Init functions run before the chart is drawn, and can be used to create custom parameterizations. The init function should take data and settings as inputs and return params which should be a list which is then provided to the chart (see the appendix for more details). The init function for the the interactive AE Explorer is a good example. It starts by merging demographics and adverse event data and then proceeds to create a customized settings object to match the configuration requirements of the javascript chart renderer. This init function is then saved under workflow$init in the chart config object.

    -

    The rest of the chart configuration YAML is similar to the examples above, and the chart is once again by passing the chart config object to safetyGraphicsApp()

    +

    Fortunately, there’s a workaround built in to safetyGraphics in the form of init workflow functions. Init functions run before the chart is drawn, and can be used to create custom parameterizations. The init function should take data and settings as inputs and return params which should be a list which is then provided to the chart (see the appendix for more details). The init function for the the interactive AE Explorer is a good example. It starts by merging demographics and adverse event data and then proceeds to create a customized settings object to match the configuration requirements of the javascript chart renderer. This init function is then saved under workflow$init in the chart config object.

    +

    The rest of the chart configuration YAML is similar to the examples above, and the chart is once again by passing the chart config object to safetyGraphicsApp()

    -
    -

    -Example 5 - Adding a Chart in a New Data Domain

    +
    +

    Example 5 - Adding a Chart in a New Data Domain +

    All of our examples so far have been focused on creating charts in our 3 default data domains (labs, adverse events and demographics), but there is no requirement that limits charts to these three data types. The data domains in the app are determined by a meta data frame that defines the columns and fields used in safetyGraphics charts, and customizing meta allows us to create charts for any desired data domains.

    Generally speaking there are 3 steps to add a chart in a new domain:

      @@ -329,52 +331,105 @@

    1. Load data for the new domain

    Consider the following example, that modifies a chart from the labs domain for use on ECG data:

    -
    adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
    +
    adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
     
    -ecg_meta <-tibble::tribble(
    -    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    -    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    -    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    -    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    -    "studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    -    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    -    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    -    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    -    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    -) %>% mutate(
    -    col_key = text_key,
    -    type="column"
    -)
    +ecg_meta <-tibble::tribble(
    +    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    +    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    +    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    +    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    +    "studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    +    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    +    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    +    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    +    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    +) %>% mutate(
    +    col_key = text_key,
    +    type="column"
    +)
     
    -qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    -qtOutliers$label <- "QT Outlier explorer"
    -qtOutliers$domain <- "custom_ecg"
    -qtOutliers$meta <- ecg_meta
    +qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    +qtOutliers$label <- "QT Outlier explorer"
    +qtOutliers$domain <- "custom_ecg"
    +qtOutliers$meta <- ecg_meta
     
    -safetyGraphicsApp(
    -    domainData=list(custom_ecg=adeg), 
    -    charts=list(qtOutliers)
    -)
    +safetyGraphicsApp( + domainData=list(custom_ecg=adeg), + charts=list(qtOutliers) +)

    As of safetyGraphics v2.1, metadata can be saved directly to the chart object using chart$meta as shown in the example above.
    Alternatively, metadata can be saved as a data object in the chart$package namespace. Chart-specific metadata should be saved as meta_{chart$name} while domain-level metadata should be named meta_{chart$domain}. It’s fine to use a combination of these approaches as appropriate for your chart. See ?safetyGraphics::makeMeta for more detail.

    -
    -

    -Appendix #1 - Chart Framework Technical Specifications

    -
    -

    -Configuration Overview

    +
    +

    Appendix #1 - Chart Framework Technical Specifications +

    +
    +

    Configuration Overview +

    -

    The diagram above summarizes the various components of the safetyGraphics charting framework: - The safetyGraphicsApp() function allows users to specify which charts to include in the shiny app via the charts parameter, which expects a list of charts. - Each item in charts is itself defined as a list that provides configuration details for a single chart. These configuration lists have several required parameters, which are described in the technical specification below. - Configuration lists are typically saved as YAML files, but can be also be loaded directly as list objects as shown in the Hello World example above. - Needed functions are bound to the chart object via the prepareChart() function. See the documentation for chart$functions below for full details.

    +

    The diagram above summarizes the various components of the safetyGraphics charting framework:

    +
      +
    • The safetyGraphicsApp() function allows users to specify which charts to include in the shiny app via the charts parameter, which expects a list of charts.
    • +
    • Each item in charts is itself defined as a list that provides configuration details for a single chart. These configuration lists have several required parameters, which are described in the technical specification below.
    • +
    • Configuration lists are typically saved as YAML files, but can be also be loaded directly as list objects as shown in the Hello World example above.
    • +
    • Needed functions are bound to the chart object via the prepareChart() function. See the documentation for chart$functions below for full details.
    • +
    -
    -

    -Chart Specification

    -

    Each item in the charts list should be a list() with the following parameters: - env: Environment for the chart. Must be set to “safetyGraphics” or the chart is dropped. Type: character. Required - name: Name of the chart. Type: character. Required - type:: Type of chart. Valid options are: “plot”,“htmlwidget”,“html”,“table” and “module”. Type: character. Required - label: A short description of the chart. chart\(name is used if not provided. Type: *character*. *Optional* - `domain`: The data domain(s) used in the chart. Type: *character*. **Required** - `package`: The package where the {htmlwidget} is saved. Type: *character*. **Required** when `chart\)typeis "htmlwidget" -meta: Table of chart-specific metadata. Metadata can also be saved as{package}::meta_{chart}or{package::meta_{domain}. See?safetyGraphics::makeMetafor more detail. -order: Order in which to display the chart. If order is a negative number, the chart is dropped. Defaults to 999999. Type: *Integer*. *Optional* -links: Named list of link names/urls to be shown in the chart header. Type: *list of character*. *Optional* -path: Full path of the YAML file. Auto-generated bymakeChartConfig()Type: *character* *optional* -workflow: Names of functions used to create the chart. Should be loaded in global environment or included inchart\(package` before calling `prepareChart()`. Supported parameters are listed below. Type: *list of character*. **Required** - `workflow\)main: name of the function to draw the chart. The function should takedataandsettingsparameters unless the input parameters are customized by aninitfunction. **Required**, unlesschart\(type` is "htmlwidget" or "module") - `workflow\)init: name of initialization function that runs before chart is drawn via the main function. Should take data and settings as input and return a list of parameters accepted by the main function. Optional - workflow$widget: name or widget saved in chart$package to be passed to htmlwidgets::createWidget Required when chart$type is “htmlwidget” - workflow$ui and workflow$server: names of functions to render shiny ui and server. Automatically generated in prepareChart() unless chart$type is “module”. Required when chart$type is ‘module’ - functions: a list of functions used to create the chart. Typically generated at runtime by prepareChart() using information in chart$workflow, chart$type and chart$package. Not recommended to generate manually. Type: list of functions. Required

    +
    +

    Chart Specification +

    +

    Each item in the charts list should be a list() with the following parameters:

    +
      +
    • +env: Environment for the chart. Must be set to “safetyGraphics” or the chart is dropped. Type: character. Required +
    • +
    • +name: Name of the chart. Type: character. Required +
    • +
    • +type:: Type of chart. Valid options are: “plot”,“htmlwidget”,“html”,“table” and “module”. Type: character. Required +
    • +
    • +label: A short description of the chart. chart$name is used if not provided. Type: character. Optional +
    • +
    • +domain: The data domain(s) used in the chart. Type: character. Required +
    • +
    • +package: The package where the {htmlwidget} is saved. Type: character. Required when chart$type is “htmlwidget”
    • +
    • +meta: Table of chart-specific metadata. Metadata can also be saved as {package}::meta_{chart} or {package::meta_{domain}. See ?safetyGraphics::makeMeta for more detail.
    • +
    • +order: Order in which to display the chart. If order is a negative number, the chart is dropped. Defaults to 999999. Type: Integer. Optional +
    • +
    • +links: Named list of link names/urls to be shown in the chart header. Type: list of character. Optional +
    • +
    • +path: Full path of the YAML file. Auto-generated by makeChartConfig() Type: character optional +
    • +
    • +workflow: Names of functions used to create the chart. Should be loaded in global environment or included in chart$package before calling prepareChart(). Supported parameters are listed below. Type: list of character. Required +
        +
      • +workflow$main: name of the function to draw the chart. The function should take data and settings parameters unless the input parameters are customized by an init function. Required, unless chart$type is “htmlwidget” or “module”)
      • +
      • +workflow$init: name of initialization function that runs before chart is drawn via themainfunction. Should takedataandsettingsas input and return a list of parameters accepted by themain` function. Optional +
      • +
      • +workflow$widget: name or widget saved in chart$package to be passed to htmlwidgets::createWidget Required when chart$type is “htmlwidget”
      • +
      • +workflow$ui and workflow$server: names of functions to render shiny ui and server. Automatically generated in prepareChart() unless chart$type is “module”. Required when chart$type is ‘module’
      • +
      +
    • +
    • +functions: a list of functions used to create the chart. Typically generated at runtime by prepareChart() using information in chart$workflow, chart$type and chart$package. Not recommended to generate manually. Type: list of functions. Required +
    • +
    -
    -

    -Default Technical workflow

    +
    +

    Default Technical workflow +

    This appendix describe the technical process used to render a chart when safetyGraphicsApp() is called with the default parameters.

    1. @@ -382,7 +437,7 @@

    2. app_startup is called, which then immediately calls makeChartConfig().
    3. -makeChartConfig() looks for charts in the safetyCharts package (the default) since no path was specified. The function looks for the package in all current .libPaths() and then looks in the inst/config folder once the package is found.
    4. +makeChartConfig() looks for charts in the safetyCharts package (the default) since no path was specified. The function looks for the package in all current .libPaths() and then looks in the inst/config folder once the package is found.

    5. makeChartConfig loads YAML configuration files in the specified directories and saves them to a list. name and path parameters are added.
    6. @@ -445,11 +500,13 @@

      -

      Site built with pkgdown 1.6.1.

      +

      +

      Site built with pkgdown 2.0.2.

      @@ -458,5 +515,7 @@

      + + diff --git a/docs/articles/index.html b/docs/articles/index.html index 29a9507a..771d4a03 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,66 +1,12 @@ - - - - - - - -Articles • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Articles • safetyGraphics - - + + - - -
      -
      - -
      - -
      +
      +
      Cookbook
      +
      +
      Technical FAQ
      +
      +
      Chart Configuration
      +
      +
      Intro to Shiny App
      +
      +
      -
      - +
      - - + + diff --git a/docs/articles/intro.html b/docs/articles/intro.html index 88f63ee6..081db8f2 100644 --- a/docs/articles/intro.html +++ b/docs/articles/intro.html @@ -19,6 +19,8 @@ + +
      +
      -
      -

      -Intro Vignette

      +
      +

      Intro Vignette +

      The safetyGraphics shiny app provides an easy-to-use shiny interface for creating shareable safety graphics for any study. This vignette provides an overview of the app’s functionality, shows how to initialize the app with your own study data, and provides links to technical resources explaining how to customize the app.

      -
      -

      -safetyGraphics Demo

      -

      A demo of shiny application using data from the {safetyData} package is hosted here. The app can also be initialized with the safetyGraphicsApp() function in the R console - see Appendix 1 for details.

      +
      +

      safetyGraphics Demo +

      +

      A demo of shiny application using data from the {safetyData} package is hosted here. The app can also be initialized with the safetyGraphicsApp() function in the R console - see Appendix 1 for details.

      Let’s take a quick look at the various pages in the app.

      -
      -

      -Home Tab

      +
      +

      Home Tab +

      A home page has a basic overview of the app.

      -
      -

      -Mapping Tab

      +
      +

      Mapping Tab +

      The Mapping tab is used to tell charts which data columns and fields to use for various chart components.

      This mapping process makes it easy to re-use charts across many different studies. You can see previews of the loaded data using the checkbox at the top of the page. The demo data has 3 data domains (labs, adverse events (aes) and demographics (dm)), but others can be added as well. The mapping tab is automatically filled in for common data standards, like the ADaM data shown here, but can also be filled in manually for non-standard data.

      -
      -

      -Filtering Tab

      +
      +

      Filtering Tab +

      The Filtering tab allows users to interactively select which participants to include in charts.

      -

      This tab is created using the filter functionality included in the {datamods} package. Whenever data is filtered in this tab, those filtered data are used in all charts (across all data domains). Note that the number of participants selected is always shown in the upper right hand corner of the app.

      +

      This tab is created using the filter functionality included in the {datamods} package. Whenever data is filtered in this tab, those filtered data are used in all charts (across all data domains). Note that the number of participants selected is always shown in the upper right hand corner of the app.

      -
      -

      -Charts Tab

      -

      Clicking the Charts tab opens a dropdown menu containing a series of charts related to clinical trial safety. Clicking the Hepatic Safety Explorer opens this page:

      +
      +

      Charts Tab +

      +

      Clicking the Charts tab opens a dropdown menu containing a series of charts related to clinical trial safety. Clicking the Hepatic Safety Explorer opens this page:

      safetyGraphics supports many different kinds of charts including web-based interactive graphics using {htmlwidgets} (like the chart shown above), static plots, plotly plots and custom shiny modules. Each chart has a header that provides details about the chart, links to chart-specific resources and buttons that allow users to download a stand-alone html report or a .R file that reproduces the chart. See the Chart Configuration Vignette for more detail about the safetyGraphics charting framework.

      -
      -

      -⚙️ (Settings) Tab

      +
      +

      ⚙️ (Settings) Tab +

      Finally, the Settings tab - shown as a gear icon ⚙️ - contains technical details that can be used to customize/troubleshoot the app. Clicking on the “Code” sub-tab (shown below) allows you to download a zip file that can be used to re-open the app with with any customizations that have been made during your current session.

      -
      -

      -Loading Study Data

      +
      +

      Loading Study Data +

      safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in appendix 2.

      There are 2 primary ways to load your study data in to the safetyGraphics shiny app:

        @@ -157,21 +159,19 @@

      1. Passing data directly to safetyGraphicsApp()
      -
      -

      -Loading data with safetyGraphicsInit() -

      +
      +

      Loading data with safetyGraphicsInit() +

      The safetyGraphicsInit() function starts a simple app that allows users to select charts and then load the data required via a point-and-click interface as shown below:

      The app dynamically determines which data sets are required for the selected charts and updates the “Data Loader” UI when the charts selection changes. Below, we’ve selected 2 charts from the labs domain - so the other data domains are automatically hidden.

      -

      Once you’ve picked charts, click the “Load” buttons in the “Data Loader” section to select data files for each domain. Data is loaded using the import functionality from the {datamods} package which allows you to select data loaded in your R session or load data files directly from your file system. datamods supports any file format that {rio} can handle including text files, Excel, SAS and SPSS format.

      +

      Once you’ve picked charts, click the “Load” buttons in the “Data Loader” section to select data files for each domain. Data is loaded using the import functionality from the {datamods} package which allows you to select data loaded in your R session or load data files directly from your file system. datamods supports any file format that {rio} can handle including text files, Excel, SAS and SPSS format.

      Once you’ve loaded files for all of the active data domains, the “Run App” button will become active. Click it to initialize the app.

      -
      -

      -Passing data to safetyGraphicsApp() -

      +
      +

      Passing data to safetyGraphicsApp() +

      You can also initialize the app with custom data directly from the R console. The basic workflow is as follows:

      1. Load your data in to the R session
      2. @@ -179,53 +179,70 @@

      3. Run safetyGraphicsApp() using the domainData to pass the list of data frames.

      Here is a simple example that starts the app with SDTM data from the safetyData library:

      -
      library(safetyData)
      -sdtm <- list(
      -    dm=safetyData::sdtm_dm,
      -    aes=safetyData::sdtm_ae,
      -    labs=safetyData::sdtm_lb
      -)
      +
      library(safetyData)
      +sdtm <- list(
      +    dm=safetyData::sdtm_dm,
      +    aes=safetyData::sdtm_ae,
      +    labs=safetyData::sdtm_lb
      +)
       
      -safetyGraphics::safetyGraphicsApp(domainData=sdtm)
      +safetyGraphics::safetyGraphicsApp(domainData=sdtm)

      This example and other use cases are described in cookbook vignette.

      -
      -

      -Large Data sets

      +
      +

      Large Data sets +

      Use the maxFileSize option to load data sets larger than 5 mb in safetyGraphicsInit (e.g. safetyGraphicsinit(maxFileSize=100)). safetyGraphicsApp() does not have size limits for data files, but note that large data (>100 mb) may cause performance issues.

      -
      -

      -Additional Resources

      -

      Several additional vignettes are available for more advanced topics: - Chart Configuration Vignette - details about the charting process including technical specifications and step-by-step instructions - Cookbook Vignette - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios - Technical FAQ Vignette - vignette discussing security, validation and other technical issues

      -

      The {safetyGraphics} app is maintained by the Interactive Safety Graphics (ISG) subteam of the ASA Biopharm-DIA Safety Working Group. You can learn more about the team and find links to recent presentations and publications at our home page.

      +
      +

      Additional Resources +

      +

      Several additional vignettes are available for more advanced topics:

      +
        +
      • +Chart Configuration Vignette - details about the charting process including technical specifications and step-by-step instructions
      • +
      • +Cookbook Vignette - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios
      • +
      • +Technical FAQ Vignette - vignette discussing security, validation and other technical issues
      • +
      +

      The {safetyGraphics} app is maintained by the Interactive Safety Graphics (ISG) subteam of the ASA Biopharm-DIA Safety Working Group. You can learn more about the team and find links to recent presentations and publications at our home page.

      -
      -

      -Appendix 1 - Initialization code

      +
      +

      Appendix 1 - Initialization code +

      We suggest running the app in RStudio with R version 4.0 or higher. The following code installs the {safetyGraphics} package and initializes the app demo:

      -
      install.packages('safetyGraphics')
      -library(safetyGraphics)
      -safetyGraphicsApp() 
      +
      install.packages('safetyGraphics')
      +library(safetyGraphics)
      +safetyGraphicsApp()

      Or to use the initialization workflow:

      -
      install.packages('safetyGraphics')
      -library(safetyGraphics)
      -safetyGraphicsInit() 
      +
      install.packages('safetyGraphics')
      +library(safetyGraphics)
      +safetyGraphicsInit()

      Or you can install the most recent development version of {safetyGraphics} and the companion package {safetyCharts} directly from GitHub:

      -
      install.packages("devtools")
      -library(devtools)
      -devtools::install_github("safetyGraphics/safetyGraphics") 
      -library(safetyGraphics)
      -devtools::install_github("safetyGraphics/safetyCharts") 
      -library(safetyCharts)
      -safetyGraphicsApp() #or safetyGraphicsInit()
      +
      install.packages("devtools")
      +library(devtools)
      +devtools::install_github("safetyGraphics/safetyGraphics") 
      +library(safetyGraphics)
      +devtools::install_github("safetyGraphics/safetyCharts") 
      +library(safetyCharts)
      +safetyGraphicsApp() #or safetyGraphicsInit()
      -
      -

      -Appendix 2 - Minimum Data Requirements

      +
      +

      Appendix 2 - Minimum Data Requirements +

      Since the safetyGraphics framework supports adding custom charts (that may have custom settings), there are no universal data requirements for the app. However, the charts included by default version of the app are built to share requirements whenever possible. These requirements are captured in an included metadata file called safetyGraphics::meta.

      -

      The most basic requirements for the 3 default domains are: - Lab results (labs) domain - Expects one record per person per visit per lab measurement with columns for: Participant ID, lab result, lab name, lower limit of normal, upper limit of normal, study day, study visit (numeric), study visit (character). See safetyGraphics::meta %>% filter(domain=="labs") for additional details and optional columns used by some charts. - Adverse Event (aes) domain - Expects one record per adverse event with columns for: Participant ID, AE Sequence, Study Day, AE Start day, AE end day, AE preferred term and AE body system. See safetyGraphics::meta %>% filter(domain=="aes") - Demographics (dm) domain - Expects one record per person with columns for: Participant ID, Sex, Race, Age and Study Treatment (optional) . See safetyGraphics::meta %>% filter(domain=="dm") for additional details.

      +

      The most basic requirements for the 3 default domains are:

      +
        +
      • +Lab results (labs) domain - Expects one record per person per visit per lab measurement with columns for: Participant ID, lab result, lab name, lower limit of normal, upper limit of normal, study day, study visit (numeric), study visit (character). See safetyGraphics::meta %>% filter(domain=="labs") for additional details and optional columns used by some charts.
      • +
      • +Adverse Event (aes) domain - Expects one record per adverse event with columns for: Participant ID, AE Sequence, Study Day, AE Start day, AE end day, AE preferred term and AE body system. See safetyGraphics::meta %>% filter(domain=="aes") +
      • +
      • +Demographics (dm) domain - Expects one record per person with columns for: Participant ID, Sex, Race, Age and Study Treatment (optional) . See safetyGraphics::meta %>% filter(domain=="dm") for additional details.
      • +
      @@ -240,11 +257,13 @@

      -

      Site built with pkgdown 1.6.1.

      +

      +

      Site built with pkgdown 2.0.2.

      @@ -253,5 +272,7 @@

      + + diff --git a/docs/authors.html b/docs/authors.html index 03ed9f3a..073d5c67 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,66 +1,12 @@ - - - - - - - -Authors • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Authors and Citation • safetyGraphics + + - - - - - -
      -
      -
      - -
      +
      - @@ -167,22 +124,20 @@

      Authors

      -
      - +
      - - + + diff --git a/docs/index.html b/docs/index.html index c69ae37e..918f943f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -19,6 +19,8 @@ + +
      -

      R build status

      -
      - - - + + diff --git a/docs/reference/chartsTabUI.html b/docs/reference/chartsTabUI.html index a47b25dd..779c8cd5 100644 --- a/docs/reference/chartsTabUI.html +++ b/docs/reference/chartsTabUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for chart module, designed to be re-used for each chart generated. — chartsTabUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for chart module, designed to be re-used for each chart generated. — chartsTabUI • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,47 +77,39 @@

      UI for chart module, designed to be re-used for each chart generated.

      UI for chart module, designed to be re-used for each chart generated.

      -
      chartsTabUI(id, chart)
      - -

      Arguments

      - - - - - - - - - - -
      id

      module id

      chart

      list containing chart specifications like those returned by makeChartConfig.

      +
      +
      chartsTabUI(id, chart)
      +
      +
      +

      Arguments

      +
      id
      +

      module id

      +
      chart
      +

      list containing chart specifications like those returned by makeChartConfig.

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/detectStandard.html b/docs/reference/detectStandard.html index a710d096..85892c9b 100644 --- a/docs/reference/detectStandard.html +++ b/docs/reference/detectStandard.html @@ -1,67 +1,12 @@ - - - - - - - -Detect the data standard used for a data set — detectStandard • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Detect the data standard used for a data set — detectStandard • safetyGraphics - - + + - - -
      -
      - -
      - -
      +
      @@ -141,265 +77,261 @@

      Detect the data standard used for a data set

      This function attempts to detect the clinical data standard used in a given R data frame.

      -
      detectStandard(data, domain = NULL, meta = NULL)
      - -

      Arguments

      - - - - - - - - - - - - - - -
      data

      A data frame in which to detect the data standard - required.

      domain

      the domain to evaluate - should match a value of meta$domain. Uses the first value in meta$domain if no value is provided.

      meta

      the metadata containing the data standards.

      - -

      Value

      +
      +
      detectStandard(data, domain = NULL, meta = NULL)
      +
      +
      +

      Arguments

      +
      data
      +

      A data frame in which to detect the data standard - required.

      +
      domain
      +

      the domain to evaluate - should match a value of meta$domain. Uses the first value in meta$domain if no value is provided.

      +
      meta
      +

      the metadata containing the data standards.

      +
      +
      +

      Value

      A data frame describing the detected standard for each "text_key" in the provided metadata. Columns are "domain", "text_key", "column" and "standard".

      -

      Details

      - -

      This function compares the columns in the provided "data" with the required columns for a given data standard/domain combination. The function is designed to work with the SDTM and ADaM CDISC(https://www.cdisc.org/) standards for clinical trial data by default. Additional standards can be added by modifying the "meta" data set included as part of this package.

      +
      +
      +

      Details

      +

      This function compares the columns in the provided "data" with the required columns for a given data standard/domain combination. The function is designed to work with the SDTM and ADaM CDISC(https://www.cdisc.org/) standards for clinical trial data by default. Additional standards can be added by modifying the "meta" data set included as part of this package.

      +
      -

      Examples

      -
      detectStandard(data=safetyData::adam_adae, meta=safetyCharts::meta_aes) -
      #> $details -#> $details$adam -#> $details$adam$standard -#> [1] "adam" -#> -#> $details$adam$mapping -#> # A tibble: 8 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 seq_col AESEQ TRUE -#> 3 stdy_col ASTDY TRUE -#> 4 endy_col AENDY TRUE -#> 5 term_col AEDECOD TRUE -#> 6 bodsys_col AEBODSYS TRUE -#> 7 severity_col AESEV TRUE -#> 8 serious_col AESER TRUE -#> -#> $details$adam$total_count -#> [1] 8 -#> -#> $details$adam$valid_count -#> [1] 8 -#> -#> $details$adam$invalid_count -#> [1] 0 -#> -#> $details$adam$match_percent -#> [1] 1 -#> -#> $details$adam$match -#> [1] "full" -#> -#> $details$adam$label -#> [1] "ADaM" -#> -#> -#> $details$sdtm -#> $details$sdtm$standard -#> [1] "sdtm" -#> -#> $details$sdtm$mapping -#> # A tibble: 8 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 seq_col AESEQ TRUE -#> 3 stdy_col NA FALSE -#> 4 endy_col NA FALSE -#> 5 term_col AEDECOD TRUE -#> 6 bodsys_col AEBODSYS TRUE -#> 7 severity_col AESEV TRUE -#> 8 serious_col AESER TRUE -#> -#> $details$sdtm$total_count -#> [1] 8 -#> -#> $details$sdtm$valid_count -#> [1] 6 -#> -#> $details$sdtm$invalid_count -#> [1] 2 -#> -#> $details$sdtm$match_percent -#> [1] 0.75 -#> -#> $details$sdtm$match -#> [1] "partial" -#> -#> $details$sdtm$label -#> [1] "Partial SDTM" -#> -#> $details$sdtm$details -#> [1] "(6/8 cols/fields matched)" -#> -#> -#> -#> $standard -#> [1] "adam" -#> -#> $label -#> [1] "ADaM" -#> -#> $standard_percent -#> [1] 1 -#> -#> $mapping -#> # A tibble: 8 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 seq_col AESEQ TRUE -#> 3 stdy_col ASTDY TRUE -#> 4 endy_col AENDY TRUE -#> 5 term_col AEDECOD TRUE -#> 6 bodsys_col AEBODSYS TRUE -#> 7 severity_col AESEV TRUE -#> 8 serious_col AESER TRUE -#>
      detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs, domain="labs" ) -
      #> $details -#> $details$adam -#> $details$adam$standard -#> [1] "adam" -#> -#> $details$adam$mapping -#> # A tibble: 8 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 value_col AVAL TRUE -#> 3 measure_col PARAM TRUE -#> 4 normal_col_low A1LO TRUE -#> 5 normal_col_high A1HI TRUE -#> 6 studyday_col ADY TRUE -#> 7 visit_col VISIT TRUE -#> 8 visitn_col VISITNUM TRUE -#> -#> $details$adam$total_count -#> [1] 8 -#> -#> $details$adam$valid_count -#> [1] 8 -#> -#> $details$adam$invalid_count -#> [1] 0 -#> -#> $details$adam$match_percent -#> [1] 1 -#> -#> $details$adam$match -#> [1] "full" -#> -#> $details$adam$label -#> [1] "ADaM" -#> -#> -#> $details$sdtm -#> $details$sdtm$standard -#> [1] "sdtm" -#> -#> $details$sdtm$mapping -#> # A tibble: 9 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 value_col LBSTRESN TRUE -#> 3 measure_col NA FALSE -#> 4 normal_col_low NA FALSE -#> 5 normal_col_high NA FALSE -#> 6 studyday_col NA FALSE -#> 7 visit_col VISIT TRUE -#> 8 visitn_col VISITNUM TRUE -#> 9 unit_col NA FALSE -#> -#> $details$sdtm$total_count -#> [1] 9 -#> -#> $details$sdtm$valid_count -#> [1] 4 -#> -#> $details$sdtm$invalid_count -#> [1] 5 -#> -#> $details$sdtm$match_percent -#> [1] 0.4444444 -#> -#> $details$sdtm$match -#> [1] "partial" -#> -#> $details$sdtm$label -#> [1] "Partial SDTM" -#> -#> $details$sdtm$details -#> [1] "(4/9 cols/fields matched)" -#> -#> -#> -#> $standard -#> [1] "adam" -#> -#> $label -#> [1] "ADaM" -#> -#> $standard_percent -#> [1] 1 -#> -#> $mapping -#> # A tibble: 8 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 value_col AVAL TRUE -#> 3 measure_col PARAM TRUE -#> 4 normal_col_low A1LO TRUE -#> 5 normal_col_high A1HI TRUE -#> 6 studyday_col ADY TRUE -#> 7 visit_col VISIT TRUE -#> 8 visitn_col VISITNUM TRUE -#>
      -
      +
      +

      Examples

      +
      detectStandard(data=safetyData::adam_adae, meta=safetyCharts::meta_aes) 
      +#> $details
      +#> $details$adam
      +#> $details$adam$standard
      +#> [1] "adam"
      +#> 
      +#> $details$adam$mapping
      +#> # A tibble: 8 × 3
      +#> # Rowwise: 
      +#>   text_key     current  valid
      +#>   <chr>        <chr>    <lgl>
      +#> 1 id_col       USUBJID  TRUE 
      +#> 2 seq_col      AESEQ    TRUE 
      +#> 3 stdy_col     ASTDY    TRUE 
      +#> 4 endy_col     AENDY    TRUE 
      +#> 5 term_col     AEDECOD  TRUE 
      +#> 6 bodsys_col   AEBODSYS TRUE 
      +#> 7 severity_col AESEV    TRUE 
      +#> 8 serious_col  AESER    TRUE 
      +#> 
      +#> $details$adam$total_count
      +#> [1] 8
      +#> 
      +#> $details$adam$valid_count
      +#> [1] 8
      +#> 
      +#> $details$adam$invalid_count
      +#> [1] 0
      +#> 
      +#> $details$adam$match_percent
      +#> [1] 1
      +#> 
      +#> $details$adam$match
      +#> [1] "full"
      +#> 
      +#> $details$adam$label
      +#> [1] "ADaM"
      +#> 
      +#> 
      +#> $details$sdtm
      +#> $details$sdtm$standard
      +#> [1] "sdtm"
      +#> 
      +#> $details$sdtm$mapping
      +#> # A tibble: 8 × 3
      +#> # Rowwise: 
      +#>   text_key     current  valid
      +#>   <chr>        <chr>    <lgl>
      +#> 1 id_col       USUBJID  TRUE 
      +#> 2 seq_col      AESEQ    TRUE 
      +#> 3 stdy_col     NA       FALSE
      +#> 4 endy_col     NA       FALSE
      +#> 5 term_col     AEDECOD  TRUE 
      +#> 6 bodsys_col   AEBODSYS TRUE 
      +#> 7 severity_col AESEV    TRUE 
      +#> 8 serious_col  AESER    TRUE 
      +#> 
      +#> $details$sdtm$total_count
      +#> [1] 8
      +#> 
      +#> $details$sdtm$valid_count
      +#> [1] 6
      +#> 
      +#> $details$sdtm$invalid_count
      +#> [1] 2
      +#> 
      +#> $details$sdtm$match_percent
      +#> [1] 0.75
      +#> 
      +#> $details$sdtm$match
      +#> [1] "partial"
      +#> 
      +#> $details$sdtm$label
      +#> [1] "Partial SDTM"
      +#> 
      +#> $details$sdtm$details
      +#> [1] "(6/8 cols/fields matched)"
      +#> 
      +#> 
      +#> 
      +#> $standard
      +#> [1] "adam"
      +#> 
      +#> $label
      +#> [1] "ADaM"
      +#> 
      +#> $standard_percent
      +#> [1] 1
      +#> 
      +#> $mapping
      +#> # A tibble: 8 × 3
      +#> # Rowwise: 
      +#>   text_key     current  valid
      +#>   <chr>        <chr>    <lgl>
      +#> 1 id_col       USUBJID  TRUE 
      +#> 2 seq_col      AESEQ    TRUE 
      +#> 3 stdy_col     ASTDY    TRUE 
      +#> 4 endy_col     AENDY    TRUE 
      +#> 5 term_col     AEDECOD  TRUE 
      +#> 6 bodsys_col   AEBODSYS TRUE 
      +#> 7 severity_col AESEV    TRUE 
      +#> 8 serious_col  AESER    TRUE 
      +#> 
      +detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs, domain="labs" ) 
      +#> $details
      +#> $details$adam
      +#> $details$adam$standard
      +#> [1] "adam"
      +#> 
      +#> $details$adam$mapping
      +#> # A tibble: 8 × 3
      +#> # Rowwise: 
      +#>   text_key        current  valid
      +#>   <chr>           <chr>    <lgl>
      +#> 1 id_col          USUBJID  TRUE 
      +#> 2 value_col       AVAL     TRUE 
      +#> 3 measure_col     PARAM    TRUE 
      +#> 4 normal_col_low  A1LO     TRUE 
      +#> 5 normal_col_high A1HI     TRUE 
      +#> 6 studyday_col    ADY      TRUE 
      +#> 7 visit_col       VISIT    TRUE 
      +#> 8 visitn_col      VISITNUM TRUE 
      +#> 
      +#> $details$adam$total_count
      +#> [1] 8
      +#> 
      +#> $details$adam$valid_count
      +#> [1] 8
      +#> 
      +#> $details$adam$invalid_count
      +#> [1] 0
      +#> 
      +#> $details$adam$match_percent
      +#> [1] 1
      +#> 
      +#> $details$adam$match
      +#> [1] "full"
      +#> 
      +#> $details$adam$label
      +#> [1] "ADaM"
      +#> 
      +#> 
      +#> $details$sdtm
      +#> $details$sdtm$standard
      +#> [1] "sdtm"
      +#> 
      +#> $details$sdtm$mapping
      +#> # A tibble: 9 × 3
      +#> # Rowwise: 
      +#>   text_key        current  valid
      +#>   <chr>           <chr>    <lgl>
      +#> 1 id_col          USUBJID  TRUE 
      +#> 2 value_col       LBSTRESN TRUE 
      +#> 3 measure_col     NA       FALSE
      +#> 4 normal_col_low  NA       FALSE
      +#> 5 normal_col_high NA       FALSE
      +#> 6 studyday_col    NA       FALSE
      +#> 7 visit_col       VISIT    TRUE 
      +#> 8 visitn_col      VISITNUM TRUE 
      +#> 9 unit_col        NA       FALSE
      +#> 
      +#> $details$sdtm$total_count
      +#> [1] 9
      +#> 
      +#> $details$sdtm$valid_count
      +#> [1] 4
      +#> 
      +#> $details$sdtm$invalid_count
      +#> [1] 5
      +#> 
      +#> $details$sdtm$match_percent
      +#> [1] 0.4444444
      +#> 
      +#> $details$sdtm$match
      +#> [1] "partial"
      +#> 
      +#> $details$sdtm$label
      +#> [1] "Partial SDTM"
      +#> 
      +#> $details$sdtm$details
      +#> [1] "(4/9 cols/fields matched)"
      +#> 
      +#> 
      +#> 
      +#> $standard
      +#> [1] "adam"
      +#> 
      +#> $label
      +#> [1] "ADaM"
      +#> 
      +#> $standard_percent
      +#> [1] 1
      +#> 
      +#> $mapping
      +#> # A tibble: 8 × 3
      +#> # Rowwise: 
      +#>   text_key        current  valid
      +#>   <chr>           <chr>    <lgl>
      +#> 1 id_col          USUBJID  TRUE 
      +#> 2 value_col       AVAL     TRUE 
      +#> 3 measure_col     PARAM    TRUE 
      +#> 4 normal_col_low  A1LO     TRUE 
      +#> 5 normal_col_high A1HI     TRUE 
      +#> 6 studyday_col    ADY      TRUE 
      +#> 7 visit_col       VISIT    TRUE 
      +#> 8 visitn_col      VISITNUM TRUE 
      +#> 
      +
      +
      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/evaluateStandard.html b/docs/reference/evaluateStandard.html index d8463268..a4a199f4 100644 --- a/docs/reference/evaluateStandard.html +++ b/docs/reference/evaluateStandard.html @@ -1,67 +1,12 @@ - - - - - - - -Evaluate a data set against a data standard — evaluateStandard • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Evaluate a data set against a data standard — evaluateStandard • safetyGraphics - - + + - - -
      -
      - -
      - -
      +
      @@ -141,148 +77,141 @@

      Evaluate a data set against a data standard

      Determines whether the required data elements in a data standard are found in a given data frame

      -
      evaluateStandard(data, meta, domain, standard)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - -
      data

      A data frame in which to detect the data standard

      meta

      the metadata containing the data standards.

      domain

      the domain to evaluate - should match a value of meta$domain

      standard

      standard to evaluate

      - -

      Value

      +
      +
      evaluateStandard(data, meta, domain, standard)
      +
      +
      +

      Arguments

      +
      data
      +

      A data frame in which to detect the data standard

      +
      meta
      +

      the metadata containing the data standards.

      +
      domain
      +

      the domain to evaluate - should match a value of meta$domain

      +
      standard
      +

      standard to evaluate

      +
      +
      +

      Value

      a list describing to what degree the data set matches the data standard. The "match" property describes compliance with the standard as "full", "partial" or "none". The "checks" property is a list of the data elements expected for the standard and whether they are "valid" in the given data set. "total_checks", "valid_checks" and "invalid_checks" provide counts of the specified checks. "match_percent" is calculated as valid_checks/total_checks. "mapping" is a data frame describing the detected standard for each "text_key" in the provided metadata. Columns are "text_key", "current" containing the name of the matched column or field value in the data and "match" a boolean indicating whether the data matches the standard.

      +
      -

      Examples

      -
      # Match is TRUE -evaluateStandard( - data=safetyData::adam_adlbc, - meta=safetyCharts::meta_labs, - domain="labs", - standard="adam" -) -
      #> $standard -#> [1] "adam" -#> -#> $mapping -#> # A tibble: 8 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 value_col AVAL TRUE -#> 3 measure_col PARAM TRUE -#> 4 normal_col_low A1LO TRUE -#> 5 normal_col_high A1HI TRUE -#> 6 studyday_col ADY TRUE -#> 7 visit_col VISIT TRUE -#> 8 visitn_col VISITNUM TRUE -#> -#> $total_count -#> [1] 8 -#> -#> $valid_count -#> [1] 8 -#> -#> $invalid_count -#> [1] 0 -#> -#> $match_percent -#> [1] 1 -#> -#> $match -#> [1] "full" -#> -#> $label -#> [1] "ADaM" -#>
      -# Match is FALSE -evaluateStandard( - data=safetyData::adam_adlbc, - meta=safetyCharts::meta_labs, - domain="labs", - standard="sdtm" -) -
      #> $standard -#> [1] "sdtm" -#> -#> $mapping -#> # A tibble: 9 × 3 -#> # Rowwise: -#> text_key current valid -#> <chr> <chr> <lgl> -#> 1 id_col USUBJID TRUE -#> 2 value_col LBSTRESN TRUE -#> 3 measure_col NA FALSE -#> 4 normal_col_low NA FALSE -#> 5 normal_col_high NA FALSE -#> 6 studyday_col NA FALSE -#> 7 visit_col VISIT TRUE -#> 8 visitn_col VISITNUM TRUE -#> 9 unit_col NA FALSE -#> -#> $total_count -#> [1] 9 -#> -#> $valid_count -#> [1] 4 -#> -#> $invalid_count -#> [1] 5 -#> -#> $match_percent -#> [1] 0.4444444 -#> -#> $match -#> [1] "partial" -#> -#> $label -#> [1] "Partial SDTM" -#> -#> $details -#> [1] "(4/9 cols/fields matched)" -#>
      -
      +
      +

      Examples

      +
      # Match is TRUE
      +evaluateStandard(
      + data=safetyData::adam_adlbc, 
      + meta=safetyCharts::meta_labs, 
      + domain="labs", 
      + standard="adam"
      +) 
      +#> $standard
      +#> [1] "adam"
      +#> 
      +#> $mapping
      +#> # A tibble: 8 × 3
      +#> # Rowwise: 
      +#>   text_key        current  valid
      +#>   <chr>           <chr>    <lgl>
      +#> 1 id_col          USUBJID  TRUE 
      +#> 2 value_col       AVAL     TRUE 
      +#> 3 measure_col     PARAM    TRUE 
      +#> 4 normal_col_low  A1LO     TRUE 
      +#> 5 normal_col_high A1HI     TRUE 
      +#> 6 studyday_col    ADY      TRUE 
      +#> 7 visit_col       VISIT    TRUE 
      +#> 8 visitn_col      VISITNUM TRUE 
      +#> 
      +#> $total_count
      +#> [1] 8
      +#> 
      +#> $valid_count
      +#> [1] 8
      +#> 
      +#> $invalid_count
      +#> [1] 0
      +#> 
      +#> $match_percent
      +#> [1] 1
      +#> 
      +#> $match
      +#> [1] "full"
      +#> 
      +#> $label
      +#> [1] "ADaM"
      +#> 
      +
      +# Match is FALSE
      +evaluateStandard(
      + data=safetyData::adam_adlbc, 
      + meta=safetyCharts::meta_labs, 
      + domain="labs", 
      + standard="sdtm"
      +) 
      +#> $standard
      +#> [1] "sdtm"
      +#> 
      +#> $mapping
      +#> # A tibble: 9 × 3
      +#> # Rowwise: 
      +#>   text_key        current  valid
      +#>   <chr>           <chr>    <lgl>
      +#> 1 id_col          USUBJID  TRUE 
      +#> 2 value_col       LBSTRESN TRUE 
      +#> 3 measure_col     NA       FALSE
      +#> 4 normal_col_low  NA       FALSE
      +#> 5 normal_col_high NA       FALSE
      +#> 6 studyday_col    NA       FALSE
      +#> 7 visit_col       VISIT    TRUE 
      +#> 8 visitn_col      VISITNUM TRUE 
      +#> 9 unit_col        NA       FALSE
      +#> 
      +#> $total_count
      +#> [1] 9
      +#> 
      +#> $valid_count
      +#> [1] 4
      +#> 
      +#> $invalid_count
      +#> [1] 5
      +#> 
      +#> $match_percent
      +#> [1] 0.4444444
      +#> 
      +#> $match
      +#> [1] "partial"
      +#> 
      +#> $label
      +#> [1] "Partial SDTM"
      +#> 
      +#> $details
      +#> [1] "(4/9 cols/fields matched)"
      +#> 
      +
      +
      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/filterTab.html b/docs/reference/filterTab.html index 8f64b472..5b60c5b9 100644 --- a/docs/reference/filterTab.html +++ b/docs/reference/filterTab.html @@ -1,67 +1,12 @@ - - - - - - - -Server for the filter module in datamods::filter_data_ui — filterTab • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for the filter module in datamods::filter_data_ui — filterTab • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,83 +77,64 @@

      Server for the filter module in datamods::filter_data_ui

      Server for the filter module in datamods::filter_data_ui

      -
      filterTab(
      -  input,
      -  output,
      -  session,
      -  domainData,
      -  filterDomain,
      -  current_mapping,
      -  tabID = "Filtering",
      -  filterVars = NULL
      -)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      input

      Shiny input object

      output

      Shiny output object

      session

      Shiny session object

      domainData

      list of data files for each domain

      filterDomain

      domain to use for filtering (typically "dm")

      current_mapping

      current data mapping

      tabID

      ID for the tab containing the filter UI (used for testing)

      filterVars

      Variables to use for filtering (used for testing)

      - -

      Value

      +
      +
      filterTab(
      +  input,
      +  output,
      +  session,
      +  domainData,
      +  filterDomain,
      +  current_mapping,
      +  tabID = "Filtering",
      +  filterVars = NULL
      +)
      +
      +
      +

      Arguments

      +
      input
      +

      Shiny input object

      +
      output
      +

      Shiny output object

      +
      session
      +

      Shiny session object

      +
      domainData
      +

      list of data files for each domain

      +
      filterDomain
      +

      domain to use for filtering (typically "dm")

      +
      current_mapping
      +

      current data mapping

      +
      tabID
      +

      ID for the tab containing the filter UI (used for testing)

      +
      filterVars
      +

      Variables to use for filtering (used for testing)

      +
      +
      +

      Value

      filtered data set

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/filterTabChecks.html b/docs/reference/filterTabChecks.html index a003e54a..1236d90a 100644 --- a/docs/reference/filterTabChecks.html +++ b/docs/reference/filterTabChecks.html @@ -1,67 +1,12 @@ - - - - - - - -Checks for whether the current data and settings support a filter tab — filterTabChecks • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Checks for whether the current data and settings support a filter tab — filterTabChecks • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,54 +77,45 @@

      Checks for whether the current data and settings support a filter tab

      Checks for whether the current data and settings support a filter tab

      -
      filterTabChecks(domainData, filterDomain, current_mapping)
      - -

      Arguments

      - - - - - - - - - - - - - - -
      domainData

      list of data files for each domain

      filterDomain

      domain to use for filtering (typically "dm")

      current_mapping

      current data mapping (REACTIVE)

      - -

      Value

      +
      +
      filterTabChecks(domainData, filterDomain, current_mapping)
      +
      +
      +

      Arguments

      +
      domainData
      +

      list of data files for each domain

      +
      filterDomain
      +

      domain to use for filtering (typically "dm")

      +
      current_mapping
      +

      current data mapping (REACTIVE)

      +
      +
      +

      Value

      reactive that returns a boolean indicating whether the checks passed and filtering can be initialized

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/filterTabUI.html b/docs/reference/filterTabUI.html index 78ad3aa4..a51a4075 100644 --- a/docs/reference/filterTabUI.html +++ b/docs/reference/filterTabUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for the filter module in datamods::filter_data_ui — filterTabUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for the filter module in datamods::filter_data_ui — filterTabUI • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,43 +77,37 @@

      UI for the filter module in datamods::filter_data_ui

      UI for the filter module in datamods::filter_data_ui

      -
      filterTabUI(id)
      - -

      Arguments

      - - - - - - -
      id

      module id

      +
      +
      filterTabUI(id)
      +
      +
      +

      Arguments

      +
      id
      +

      module id

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/generateMappingList.html b/docs/reference/generateMappingList.html index a9e4efd5..312828f6 100644 --- a/docs/reference/generateMappingList.html +++ b/docs/reference/generateMappingList.html @@ -1,67 +1,12 @@ - - - - - - - -Convert mapping data.frame to a list — generateMappingList • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Convert mapping data.frame to a list — generateMappingList • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,51 +77,41 @@

      Convert mapping data.frame to a list

      Convert mapping data.frame to a list

      -
      generateMappingList(settingsDF, domain = NULL, pull = FALSE)
      - -

      Arguments

      - - - - - - - - - - - - - - -
      settingsDF

      data frame containing current mapping

      domain

      mapping domain to return (returns all domains as a named list by default)

      pull

      call pull() the value for each parameter - needed for testing only. default: FALSE

      +
      +
      generateMappingList(settingsDF, domain = NULL, pull = FALSE)
      +
      +
      +

      Arguments

      +
      settingsDF
      +

      data frame containing current mapping

      +
      domain
      +

      mapping domain to return (returns all domains as a named list by default)

      +
      pull
      +

      call pull() the value for each parameter - needed for testing only. default: FALSE

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/hasColumn.html b/docs/reference/hasColumn.html index 0efe9fb0..714b6cc7 100644 --- a/docs/reference/hasColumn.html +++ b/docs/reference/hasColumn.html @@ -1,67 +1,12 @@ - - - - - - - -Check whether a column is found in a data set — hasColumn • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Check whether a column is found in a data set — hasColumn • safetyGraphics - - + + - - -
      -
      - -
      - -
      +
      @@ -141,55 +77,52 @@

      Check whether a column is found in a data set

      Checks whether a specified column is found in a specified data set

      -
      hasColumn(columnName, data)
      - -

      Arguments

      - - - - - - - - - - -
      columnName

      The column to look for.

      data

      the data.frame to search.

      - -

      Value

      +
      +
      hasColumn(columnName, data)
      +
      +
      +

      Arguments

      +
      columnName
      +

      The column to look for.

      +
      data
      +

      the data.frame to search.

      +
      +
      +

      Value

      logical scalar. TRUE if the column is found. FALSE otherwise

      +
      -

      Examples

      -
      safetyGraphics:::hasColumn(columnName="PARAM",data=safetyData::adam_adlbc) #TRUE -
      #> [1] TRUE
      safetyGraphics:::hasColumn(columnName="Not_a_column",data=safetyData::adam_adlbc) #FALSE -
      #> [1] FALSE
      -
      +
      +

      Examples

      +
      safetyGraphics:::hasColumn(columnName="PARAM",data=safetyData::adam_adlbc) #TRUE
      +#> [1] TRUE
      +safetyGraphics:::hasColumn(columnName="Not_a_column",data=safetyData::adam_adlbc) #FALSE
      +#> [1] FALSE
      +
      +
      +
      +
      -
      - +

      - - + + diff --git a/docs/reference/hasField.html b/docs/reference/hasField.html index 83a5852e..71303d31 100644 --- a/docs/reference/hasField.html +++ b/docs/reference/hasField.html @@ -1,67 +1,12 @@ - - - - - - - -Check whether a specified field value is found in a data set — hasField • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Check whether a specified field value is found in a data set — hasField • safetyGraphics - + + - - - -
      -
      - -
      - -
      +
      @@ -141,70 +77,65 @@

      Check whether a specified field value is found in a data set

      This checks whether a specific value is found in a specified column in a specified data set

      -
      hasField(fieldValue, columnName, data)
      - -

      Arguments

      - - - - - - - - - - - - - - -
      fieldValue

      A value to check for.

      columnName

      The column to check.

      data

      the data.frame to search.

      - -

      Value

      +
      +
      hasField(fieldValue, columnName, data)
      +
      +
      +

      Arguments

      +
      fieldValue
      +

      A value to check for.

      +
      columnName
      +

      The column to check.

      +
      data
      +

      the data.frame to search.

      +
      +
      +

      Value

      logical scalar. TRUE if field_value is found. FALSE otherwise

      +
      -

      Examples

      -
      #TRUE -safetyGraphics:::hasField( - fieldValue="Bilirubin (umol/L)", - columnName="PARAM", - data=safetyData::adam_adlbc -) -
      #> [1] TRUE
      -#FALSE -safetyGraphics:::hasField( - fieldValue="Not_a_real_value", - columnName="", - data=safetyData::adam_adlbc -) -
      #> [1] FALSE
      -
      +
      +

      Examples

      +
      #TRUE
      +safetyGraphics:::hasField(
      + fieldValue="Bilirubin (umol/L)",
      + columnName="PARAM",
      + data=safetyData::adam_adlbc
      +)
      +#> [1] TRUE
      +
      +#FALSE
      +safetyGraphics:::hasField(
      + fieldValue="Not_a_real_value",
      + columnName="",
      + data=safetyData::adam_adlbc
      +)
      +#> [1] FALSE
      +
      +
      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/homeTab.html b/docs/reference/homeTab.html index ba122420..2beb9445 100644 --- a/docs/reference/homeTab.html +++ b/docs/reference/homeTab.html @@ -1,67 +1,12 @@ - - - - - - - -Server for the filter module in datamods::filter_data_ui — homeTab • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for the filter module in datamods::filter_data_ui — homeTab • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,51 +77,41 @@

      Server for the filter module in datamods::filter_data_ui

      Server for the filter module in datamods::filter_data_ui

      -
      homeTab(input, output, session)
      - -

      Arguments

      - - - - - - - - - - - - - - -
      input

      mod input

      output

      mod output

      session

      mod session

      +
      +
      homeTab(input, output, session)
      +
      +
      +

      Arguments

      +
      input
      +

      mod input

      +
      output
      +

      mod output

      +
      session
      +

      mod session

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/homeTabUI.html b/docs/reference/homeTabUI.html index 20bbfd88..808bd9c4 100644 --- a/docs/reference/homeTabUI.html +++ b/docs/reference/homeTabUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for the home module — homeTabUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for the home module — homeTabUI • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,43 +77,37 @@

      UI for the home module

      UI for the home module

      -
      homeTabUI(id)
      - -

      Arguments

      - - - - - - -
      id

      module id

      +
      +
      homeTabUI(id)
      +
      +
      +

      Arguments

      +
      id
      +

      module id

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 845522bc..40a3985d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,66 +1,12 @@ - - - - - - - -Function reference • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function reference • safetyGraphics - - + + - - -
      -
      - -
      - -
      +
      - - - - - - - - - - -
      -

      Main Shiny App Functions

      + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      +

      Main Shiny App Functions

      +

      safetyGraphicsApp()

      Run the core safetyGraphics App

      +

      safetyGraphicsInit()

      App to select charts, load data and then initialize the core safetyGraphics app

      -

      Shiny Modules

      -

      Reusable Shiny Modules

      +
      +

      Shiny Modules

      +

      Reusable Shiny Modules

      +

      safetyGraphicsServer()

      Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

      +

      safetyGraphicsUI()

      UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

      +

      chartsTab()

      Server for chart module, designed to be re-used for each chart generated.

      +

      chartsTabUI()

      UI for chart module, designed to be re-used for each chart generated.

      +

      filterTab()

      Server for the filter module in datamods::filter_data_ui

      +

      filterTabUI()

      UI for the filter module in datamods::filter_data_ui

      +

      homeTab()

      Server for the filter module in datamods::filter_data_ui

      +

      homeTabUI()

      UI for the home module

      +

      loadCharts()

      Server for the chart loading module used in safetyGraphicsInit()

      +

      loadChartsUI()

      UI for the chart loading module used in safetyGraphicsInit()

      +

      loadData()

      Server for the data loading module used in safetyGraphicsInit()

      +

      loadDataUI()

      UI for the data loading module used in safetyGraphicsInit()

      +

      mappingTab()

      Server for mapping tab covering of all data domains

      +

      mappingTabUI()

      UI for mapping tab covering of all data domains

      +

      mappingDomain()

      Server that facilitates the mapping of a full data domain

      +

      mappingDomainUI()

      UI that facilitates the mapping of a full data domain

      +

      mappingColumn()

      Server that facilitates the mapping of a column data (and any associated fields)

      +

      mappingColumnUI()

      UI that facilitates the mapping of a column data (and any associated fields)

      +

      mappingSelect()

      Server that facilitates the mapping of a single data element (column or field) with a simple select UI

      +

      mappingSelectUI()

      UI that facilitates the mapping of a single data element (column or field) with a simple select UI

      +

      settingsTab()

      Server for the setting page

      +

      settingsTabUI()

      UI for the settings tab

      +

      settingsCharts()

      Server for settings tab showing details for the charts loaded in the app

      +

      settingsChartsUI()

      UI for settings tab showing details for the charts loaded in the app

      +

      settingsData()

      Server for settings tab showing current data

      +

      settingsDataUI()

      UI for settings tab showing current data

      +

      settingsMapping()

      Server for settings tab showing current mapping

      +

      settingsMappingUI()

      UI for settings tab showing current mapping

      +

      settingsCode()

      Server for settings tab providing code to re-start the app with current data/settings

      +

      settingsCodeUI()

      UI for settings tab providing code to re-start the app with current data/settings

      -

      Helper Functions

      -

      Utility functions used in the apps

      +
      +

      Helper Functions

      +

      Utility functions used in the apps

      +

      app_startup()

      Startup code for shiny app

      +

      chartsNav()

      Adds a navbar tab that initializes the Chart Module UI

      +

      detectStandard()

      Detect the data standard used for a data set

      +

      evaluateStandard()

      Evaluate a data set against a data standard

      +

      filterTabChecks()

      Checks for whether the current data and settings support a filter tab

      +

      generateMappingList()

      Convert mapping data.frame to a list

      +

      makeChartConfig()

      Make Chart Config

      +

      makeChartExport()

      Make Chart Export

      +

      makeChartParams()

      Make Chart Parameters

      +

      makeChartSummary()

      html chart summary

      +

      makeMapping()

      Create data mapping based on data standards and user input

      +

      makeMeta()

      Create a metadata object table for a set of charts

      +

      prepareChart()

      Prepare a chart object for safetyGraphics

      - +
      +
      -
      - +
      - - + + diff --git a/docs/reference/loadCharts.html b/docs/reference/loadCharts.html index 683cf100..56ed5e02 100644 --- a/docs/reference/loadCharts.html +++ b/docs/reference/loadCharts.html @@ -1,67 +1,12 @@ - - - - - - - -Server for the chart loading module used in safetyGraphicsInit() — loadCharts • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for the chart loading module used in safetyGraphicsInit() — loadCharts • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,55 +77,43 @@

      Server for the chart loading module used in safetyGraphicsInit()

      Server for the chart loading module used in safetyGraphicsInit()

      -
      loadCharts(input, output, session, charts = makeChartConfig())
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - -
      input

      Shiny input object

      output

      Shiny output object

      session

      Shiny session object

      charts

      list containing chart specifications like those returned by makeChartConfig.

      +
      +
      loadCharts(input, output, session, charts = makeChartConfig())
      +
      +
      +

      Arguments

      +
      input
      +

      Shiny input object

      +
      output
      +

      Shiny output object

      +
      session
      +

      Shiny session object

      +
      charts
      +

      list containing chart specifications like those returned by makeChartConfig.

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/loadChartsUI.html b/docs/reference/loadChartsUI.html index 3184ac15..389688a6 100644 --- a/docs/reference/loadChartsUI.html +++ b/docs/reference/loadChartsUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for the chart loading module used in safetyGraphicsInit() — loadChartsUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for the chart loading module used in safetyGraphicsInit() — loadChartsUI • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,47 +77,39 @@

      UI for the chart loading module used in safetyGraphicsInit()

      UI for the chart loading module used in safetyGraphicsInit()

      -
      loadChartsUI(id, charts = makeChartConfig())
      - -

      Arguments

      - - - - - - - - - - -
      id

      module id

      charts

      list containing chart specifications like those returned by makeChartConfig.

      +
      +
      loadChartsUI(id, charts = makeChartConfig())
      +
      +
      +

      Arguments

      +
      id
      +

      module id

      +
      charts
      +

      list containing chart specifications like those returned by makeChartConfig.

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/loadData.html b/docs/reference/loadData.html index a0d764d8..7b091f4a 100644 --- a/docs/reference/loadData.html +++ b/docs/reference/loadData.html @@ -1,67 +1,12 @@ - - - - - - - -Server for the data loading module used in safetyGraphicsInit() — loadData • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for the data loading module used in safetyGraphicsInit() — loadData • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,55 +77,43 @@

      Server for the data loading module used in safetyGraphicsInit()

      Server for the data loading module used in safetyGraphicsInit()

      -
      loadData(input, output, session, domain)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - -
      input

      Shiny input object

      output

      Shiny output object

      session

      Shiny session object

      domain

      data domain to be loaded

      +
      +
      loadData(input, output, session, domain)
      +
      +
      +

      Arguments

      +
      input
      +

      Shiny input object

      +
      output
      +

      Shiny output object

      +
      session
      +

      Shiny session object

      +
      domain
      +

      data domain to be loaded

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/loadDataUI.html b/docs/reference/loadDataUI.html index 73f465ed..460107fe 100644 --- a/docs/reference/loadDataUI.html +++ b/docs/reference/loadDataUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for the data loading module used in safetyGraphicsInit() — loadDataUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for the data loading module used in safetyGraphicsInit() — loadDataUI • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,47 +77,39 @@

      UI for the data loading module used in safetyGraphicsInit()

      UI for the data loading module used in safetyGraphicsInit()

      -
      loadDataUI(id, domain = NULL)
      - -

      Arguments

      - - - - - - - - - - -
      id

      module id

      domain

      character vector with domains to be loaded

      +
      +
      loadDataUI(id, domain = NULL)
      +
      +
      +

      Arguments

      +
      id
      +

      module id

      +
      domain
      +

      character vector with domains to be loaded

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/makeChartConfig.html b/docs/reference/makeChartConfig.html index a19a3ab9..4a597c81 100644 --- a/docs/reference/makeChartConfig.html +++ b/docs/reference/makeChartConfig.html @@ -1,67 +1,12 @@ - - - - - - - -Make Chart Config — makeChartConfig • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Make Chart Config — makeChartConfig • safetyGraphics - + + - - - -
      -
      - -
      - -
      +
      @@ -141,38 +77,29 @@

      Make Chart Config

      Converts YAML chart configuration files to an R list and binds workflow functions. See the vignette about creating custom charts for more details.

      -
      makeChartConfig(
      -  dirs,
      -  packages = "safetyCharts",
      -  packageLocation = "config",
      -  sourceFiles = FALSE
      -)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - -
      dirs

      path to one or more directories containing yaml config files (relative to working directory)

      packages

      installed packages names containing yaml config files in the /inst/packageLocation folder

      packageLocation

      inst folder where yaml config files (and possibly R functions referenced in yaml workflow) are located in packages

      sourceFiles

      boolean indicating whether to source all R files found in dirs.

      - -

      Value

      - -

      returns a named list of charts derived from YAML files. Each element of the list contains information about a single chart, and has the following parameters:

        -
      • "env" Environment for the chart. Must be set to "safetyGraphics" or the chart is dropped.

      • +
        +
        makeChartConfig(
        +  dirs,
        +  packages = "safetyCharts",
        +  packageLocation = "config",
        +  sourceFiles = FALSE
        +)
        +
        + +
        +

        Arguments

        +
        dirs
        +

        path to one or more directories containing yaml config files (relative to working directory)

        +
        packages
        +

        installed packages names containing yaml config files in the /inst/packageLocation folder

        +
        packageLocation
        +

        inst folder where yaml config files (and possibly R functions referenced in yaml workflow) are located in packages

        +
        sourceFiles
        +

        boolean indicating whether to source all R files found in dirs.

        +
        +
        +

        Value

        +

        returns a named list of charts derived from YAML files. Each element of the list contains information about a single chart, and has the following parameters:

        • "env" Environment for the chart. Must be set to "safetyGraphics" or the chart is dropped.

        • "name" Name of the chart. Also the name of the element in the list - e.g. charts$aeExplorer$name is "aeExplorer"

        • "label" Short description of the chart

        • "type" Type of chart; options are: 'htmlwidget', 'module', 'plot', 'table', 'html' or 'plotly'.

        • @@ -184,34 +111,29 @@

          Value

        • "links" Named list of link names/urls to be shown in the chart header.

        • "workflow" List of functions names used to render chart. See vignette for details.

        • "functions" List of functions for use in chart renderering. These functions must be located in the global environment or package field of the YAML config. Function names must include either the name or workflow fields of the YAML config.

        • -
        - +
      +
      -
      - +
      - - + + diff --git a/docs/reference/makeChartExport.html b/docs/reference/makeChartExport.html index 716521f2..ac7c4113 100644 --- a/docs/reference/makeChartExport.html +++ b/docs/reference/makeChartExport.html @@ -1,67 +1,12 @@ - - - - - - - -Make Chart Export — makeChartExport • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Make Chart Export — makeChartExport • safetyGraphics - + + - - - -
      -
      - -
      - -
      +
      @@ -141,50 +77,43 @@

      Make Chart Export

      Creates R code that allows chart to be exported

      -
      makeChartExport(chart, mapping)
      - -

      Arguments

      - - - - - - - - - - -
      chart

      chart object like the one generated by makeChartConfig().

      mapping

      mapping object like the one generated by makeMapping().

      - -

      Value

      +
      +
      makeChartExport(chart, mapping)
      +
      +
      +

      Arguments

      +
      chart
      +

      chart object like the one generated by makeChartConfig().

      +
      mapping
      +

      mapping object like the one generated by makeMapping().

      +
      +
      +

      Value

      returns a character vector that can be saved as R code.

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/makeChartParams.html b/docs/reference/makeChartParams.html index 8dc730b3..048d24cb 100644 --- a/docs/reference/makeChartParams.html +++ b/docs/reference/makeChartParams.html @@ -1,67 +1,12 @@ - - - - - - - -Make Chart Parameters — makeChartParams • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Make Chart Parameters — makeChartParams • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,51 +77,41 @@

      Make Chart Parameters

      Updates raw data and mapping for use with a specific chart

      -
      makeChartParams(data, chart, mapping)
      - -

      Arguments

      - - - - - - - - - - - - - - -
      data

      list of domain-level data

      chart

      list containing chart specifications

      mapping

      data frame with current mapping

      +
      +
      makeChartParams(data, chart, mapping)
      +
      +
      +

      Arguments

      +
      data
      +

      list of domain-level data

      +
      chart
      +

      list containing chart specifications

      +
      mapping
      +

      data frame with current mapping

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/makeChartSummary.html b/docs/reference/makeChartSummary.html index cf3c9f40..501e15ff 100644 --- a/docs/reference/makeChartSummary.html +++ b/docs/reference/makeChartSummary.html @@ -1,67 +1,12 @@ - - - - - - - -html chart summary — makeChartSummary • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -html chart summary — makeChartSummary • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,51 +77,41 @@

      html chart summary

      makes a nicely formatted html summary for a chart object

      -
      makeChartSummary(chart, showLinks = TRUE, class = "chart-header")
      - -

      Arguments

      - - - - - - - - - - - - - - -
      chart

      list containing chart specifications

      showLinks

      boolean indicating whether to include links

      class

      character to include as class

      +
      +
      makeChartSummary(chart, showLinks = TRUE, class = "chart-header")
      +
      +
      +

      Arguments

      +
      chart
      +

      list containing chart specifications

      +
      showLinks
      +

      boolean indicating whether to include links

      +
      class
      +

      character to include as class

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/makeMapping.html b/docs/reference/makeMapping.html index 96d8398e..f261cbd4 100644 --- a/docs/reference/makeMapping.html +++ b/docs/reference/makeMapping.html @@ -1,67 +1,12 @@ - - - - - - - -Create data mapping based on data standards and user input — makeMapping • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Create data mapping based on data standards and user input — makeMapping • safetyGraphics - + + - - - -
      -
      - -
      - -
      +
      @@ -141,62 +77,48 @@

      Create data mapping based on data standards and user input

      Create data mapping based on data standards and user input

      -
      makeMapping(domainData, meta, autoMapping, customMapping)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - -
      domainData

      named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

      meta

      data frame containing the metadata for use in the app.

      autoMapping

      boolean indicating whether the app should use safetyGraphics::detectStandard() to detect data standards and automatically generate mappings for the data provided. Values specified in the customMapping parameter overwrite auto-generated mappings when both are found. Defaults to true.

      customMapping

      optional list specifying initial mapping values within each data mapping (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

      - -

      Value

      - -

      List containing data standard information and mapping

        -
      • "mapping" Initial Data Mapping

      • -
      • "standards" List of domain level data standards (or NULL if autoMapping is false)

      • -
      +
      +
      makeMapping(domainData, meta, autoMapping, customMapping)
      +
      +
      +

      Arguments

      +
      domainData
      +

      named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

      +
      meta
      +

      data frame containing the metadata for use in the app.

      +
      autoMapping
      +

      boolean indicating whether the app should use safetyGraphics::detectStandard() to detect data standards and automatically generate mappings for the data provided. Values specified in the customMapping parameter overwrite auto-generated mappings when both are found. Defaults to true.

      +
      customMapping
      +

      optional list specifying initial mapping values within each data mapping (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

      +
      +
      +

      Value

      +

      List containing data standard information and mapping

      • "mapping" Initial Data Mapping

      • +
      • "standards" List of domain level data standards (or NULL if autoMapping is false)

      • +
      +
      -
      - +
      - - + + diff --git a/docs/reference/makeMeta.html b/docs/reference/makeMeta.html index 25e7417d..d7e91daa 100644 --- a/docs/reference/makeMeta.html +++ b/docs/reference/makeMeta.html @@ -1,73 +1,18 @@ - - - - - - - -Create a metadata object table for a set of charts — makeMeta • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Create a metadata object table for a set of charts — makeMeta • safetyGraphics - - - - - - - - - - - - - + + -
      -
      - -
      - -
      +
      -

      Generates metadata object for a list of charts. makeMeta() looks for metadata in 3 locations for each chart object:

        -
      • Domain-level metadata saved as meta_chart$name in the chart$package namespace

      • +

        Generates metadata object for a list of charts. makeMeta() looks for metadata in 3 locations for each chart object:

        • Domain-level metadata saved as meta_chart$name in the chart$package namespace

        • Chart-specific metadata saved as meta_chart$domain in the chart$package namespace

        • Chart-specific metadata saved directly to the chart object as chart$meta After checking all charts, all metadata files are stacked in to a single dataframe and returned. If duplicate metadata rows (domain + text_key) are found, an error is thrown.

        • -
        +
      +
      +
      makeMeta(charts)
      -
      makeMeta(charts)
      +
      +

      Arguments

      +
      charts
      +

      list of safetyGraphics chart objects for which to create metadata

      +
      +
      +

      Value

      +

      tibble of metadata with the following columns:

      domain
      +

      Data domain

      -

      Arguments

      - - - - - - -
      charts

      list of safetyGraphics chart objects for which to create metadata

      +
      text_key
      +

      Text key indicating the setting name. '--' delimiter indicates a field level data mapping

      -

      Value

      +
      col_key
      +

      Key for the column mapping

      -

      tibble of metadata with the following columns:

      -
      domain

      Data domain

      -
      text_key

      Text key indicating the setting name. '--' delimiter indicates a field level data mapping

      -
      col_key

      Key for the column mapping

      -
      field_key

      Key for the field mapping (if any)

      -
      type

      type of mapping - "field" or "column"

      -
      label

      Label

      -
      description

      Description

      -
      multiple

      Mapping supports multiple columns/fields

      -
      standard_adam

      Default values for the ADaM data standard

      -
      standard_sdtm

      Default values for the SDTM data standard

      +
      field_key
      +

      Key for the field mapping (if any)

      -
      +
      type
      +

      type of mapping - "field" or "column"

      +
      label
      +

      Label

      + +
      description
      +

      Description

      + +
      multiple
      +

      Mapping supports multiple columns/fields

      + +
      standard_adam
      +

      Default values for the ADaM data standard

      + +
      standard_sdtm
      +

      Default values for the SDTM data standard

      + + +
      +
      -
      - +
      - - + + diff --git a/docs/reference/mappingColumn.html b/docs/reference/mappingColumn.html index 874b8f99..96afa46e 100644 --- a/docs/reference/mappingColumn.html +++ b/docs/reference/mappingColumn.html @@ -1,67 +1,12 @@ - - - - - - - -Server that facilitates the mapping of a column data (and any associated fields) — mappingColumn • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server that facilitates the mapping of a column data (and any associated fields) — mappingColumn • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,62 +77,49 @@

      Server that facilitates the mapping of a column data (and any associated fie

      Server that facilitates the mapping of a column data (and any associated fields)

      -
      mappingColumn(input, output, session, meta, data)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - - - - - -
      input

      Shiny input object

      output

      Shiny output object

      session

      Shiny session object

      meta

      metadata data frame for the object

      data

      current data file for the domain

      - -

      Value

      +
      +
      mappingColumn(input, output, session, meta, data)
      +
      +
      +

      Arguments

      +
      input
      +

      Shiny input object

      +
      output
      +

      Shiny output object

      +
      session
      +

      Shiny session object

      +
      meta
      +

      metadata data frame for the object

      +
      data
      +

      current data file for the domain

      +
      +
      +

      Value

      A reactive data.frame providing the current value for text_key associated with the selected column

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/mappingColumnUI.html b/docs/reference/mappingColumnUI.html index 7b4ef9a8..068b7431 100644 --- a/docs/reference/mappingColumnUI.html +++ b/docs/reference/mappingColumnUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI that facilitates the mapping of a column data (and any associated fields) — mappingColumnUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI that facilitates the mapping of a column data (and any associated fields) — mappingColumnUI • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,55 +77,43 @@

      UI that facilitates the mapping of a column data (and any associated fields)

      UI that facilitates the mapping of a column data (and any associated fields)

      -
      mappingColumnUI(id, meta, data, mapping = NULL)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - -
      id

      module id

      meta

      metadata for the column (and related fields)

      data

      current data file for the domain

      mapping

      current data mapping for the column (and related fields)

      +
      +
      mappingColumnUI(id, meta, data, mapping = NULL)
      +
      +
      +

      Arguments

      +
      id
      +

      module id

      +
      meta
      +

      metadata for the column (and related fields)

      +
      data
      +

      current data file for the domain

      +
      mapping
      +

      current data mapping for the column (and related fields)

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/mappingDomain.html b/docs/reference/mappingDomain.html index 592284c6..0de30f59 100644 --- a/docs/reference/mappingDomain.html +++ b/docs/reference/mappingDomain.html @@ -1,67 +1,12 @@ - - - - - - - -Server that facilitates the mapping of a full data domain — mappingDomain • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server that facilitates the mapping of a full data domain — mappingDomain • safetyGraphics + + - - - - -
      -
      - -
      - -
      +
      @@ -141,62 +77,49 @@

      Server that facilitates the mapping of a full data domain

      Server that facilitates the mapping of a full data domain

      -
      mappingDomain(input, output, session, meta, data)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - - - - - -
      input

      Shiny input object

      output

      Shiny output object

      session

      Shiny session object

      meta

      metadata for the domain

      data

      clinical data for the domain

      - -

      Value

      +
      +
      mappingDomain(input, output, session, meta, data)
      +
      +
      +

      Arguments

      +
      input
      +

      Shiny input object

      +
      output
      +

      Shiny output object

      +
      session
      +

      Shiny session object

      +
      meta
      +

      metadata for the domain

      +
      data
      +

      clinical data for the domain

      +
      +
      +

      Value

      A reactive data frame containing the mapping for the domain

      +
      +
      -
      - +
      - - + + diff --git a/docs/reference/mappingDomainUI.html b/docs/reference/mappingDomainUI.html index 37a0631f..bcd2fe14 100644 --- a/docs/reference/mappingDomainUI.html +++ b/docs/reference/mappingDomainUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI that facilitates the mapping of a full data domain — mappingDomainUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI that facilitates the mapping of a full data domain — mappingDomainUI • safetyGraphics - - - - + + -
      -
      - -
      - -
      +
      @@ -141,55 +77,43 @@

      UI that facilitates the mapping of a full data domain

      UI that facilitates the mapping of a full data domain

      -
      mappingDomainUI(id, meta, data, mapping = NULL)
      - -

      Arguments

      - - - - - - - - - - - - - - - - - - -
      id

      module id

      meta

      metadata for the domain

      data

      data file for the domain

      mapping

      current data mapping

      +
      +
      mappingDomainUI(id, meta, data, mapping = NULL)
      +
      +
      +

      Arguments

      +
      id
      +

      module id

      +
      meta
      +

      metadata for the domain

      +
      data
      +

      data file for the domain

      +
      mapping
      +

      current data mapping

      +
      +
      -
      - +

    - - + + diff --git a/docs/reference/mappingSelect.html b/docs/reference/mappingSelect.html index 18afcf1b..3d7efbb1 100644 --- a/docs/reference/mappingSelect.html +++ b/docs/reference/mappingSelect.html @@ -1,67 +1,12 @@ - - - - - - - -Server that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelect • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelect • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,54 +77,45 @@

    Server that facilitates the mapping of a single data element (column or fiel

    Server that facilitates the mapping of a single data element (column or field) with a simple select UI

    -
    mappingSelect(input, output, session)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    - -

    Value

    +
    +
    mappingSelect(input, output, session)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    +
    +

    Value

    A reactive containing the selected column

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/mappingSelectUI.html b/docs/reference/mappingSelectUI.html index 9c850a95..fe6d3325 100644 --- a/docs/reference/mappingSelectUI.html +++ b/docs/reference/mappingSelectUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelectUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelectUI • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,58 +77,47 @@

    UI that facilitates the mapping of a single data element (column or field) w

    UI that facilitates the mapping of a single data element (column or field) with a simple select UI

    -
    mappingSelectUI(id, label, choices = NULL, default = NULL)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    id

    unique id for the UI

    label

    label associated with the control

    choices

    a list of options for the control

    default

    default value for the control

    - -

    Value

    +
    +
    mappingSelectUI(id, label, choices = NULL, default = NULL)
    +
    +
    +

    Arguments

    +
    id
    +

    unique id for the UI

    +
    label
    +

    label associated with the control

    +
    choices
    +

    a list of options for the control

    +
    default
    +

    default value for the control

    +
    +
    +

    Value

    returns the selected value wrapped in a reactive().

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/mappingTab.html b/docs/reference/mappingTab.html index 0a0ddc55..d3f852cd 100644 --- a/docs/reference/mappingTab.html +++ b/docs/reference/mappingTab.html @@ -1,67 +1,12 @@ - - - - - - - -Server for mapping tab covering of all data domains — mappingTab • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for mapping tab covering of all data domains — mappingTab • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,62 +77,49 @@

    Server for mapping tab covering of all data domains

    Server for mapping tab covering of all data domains

    -
    mappingTab(input, output, session, meta, domainData)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    meta

    metadata for all domains

    domainData

    clinical data for all domains

    - -

    Value

    +
    +
    mappingTab(input, output, session, meta, domainData)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    meta
    +

    metadata for all domains

    +
    domainData
    +

    clinical data for all domains

    +
    +
    +

    Value

    list of mappings for all domains

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/mappingTabUI.html b/docs/reference/mappingTabUI.html index e1cb6f35..0267550a 100644 --- a/docs/reference/mappingTabUI.html +++ b/docs/reference/mappingTabUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for mapping tab covering of all data domains — mappingTabUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for mapping tab covering of all data domains — mappingTabUI • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,59 +77,45 @@

    UI for mapping tab covering of all data domains

    UI for mapping tab covering of all data domains

    -
    mappingTabUI(id, meta, domainData, mappings = NULL, standards = NULL)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    id

    module id

    meta

    metadata for all domains

    domainData

    list of data files for each domain

    mappings

    optional data frame containing stacked mappings for all domains

    standards

    optional list of data standards like the ones generated by detectStandard()

    +
    +
    mappingTabUI(id, meta, domainData, mappings = NULL, standards = NULL)
    +
    +
    +

    Arguments

    +
    id
    +

    module id

    +
    meta
    +

    metadata for all domains

    +
    domainData
    +

    list of data files for each domain

    +
    mappings
    +

    optional data frame containing stacked mappings for all domains

    +
    standards
    +

    optional list of data standards like the ones generated by detectStandard()

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/prepareChart.html b/docs/reference/prepareChart.html index 3d7a67ac..4048c970 100644 --- a/docs/reference/prepareChart.html +++ b/docs/reference/prepareChart.html @@ -1,67 +1,12 @@ - - - - - - - -Prepare a chart object for safetyGraphics — prepareChart • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Prepare a chart object for safetyGraphics — prepareChart • safetyGraphics - + + - - - -
    -
    - -
    - -
    +
    @@ -141,46 +77,41 @@

    Prepare a chart object for safetyGraphics

    Sets default values and binds needed functions to a chart object based on chart type.

    -
    prepareChart(chart)
    - -

    Arguments

    - - - - - - -
    chart

    chart object like the one generated by makeChartConfig().

    - -

    Value

    +
    +
    prepareChart(chart)
    +
    +
    +

    Arguments

    +
    chart
    +

    chart object like the one generated by makeChartConfig().

    +
    +
    +

    Value

    returns the chart object with a new functions object added.

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/safetyGraphicsApp.html b/docs/reference/safetyGraphicsApp.html index e460160a..55735e8f 100644 --- a/docs/reference/safetyGraphicsApp.html +++ b/docs/reference/safetyGraphicsApp.html @@ -1,67 +1,12 @@ - - - - - - - -Run the core safetyGraphics App — safetyGraphicsApp • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Run the core safetyGraphics App — safetyGraphicsApp • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,81 +77,61 @@

    Run the core safetyGraphics App

    Run the core safetyGraphics App

    -
    safetyGraphicsApp(
    -  domainData = list(labs = safetyData::adam_adlbc, aes = safetyData::adam_adae, dm =
    -    safetyData::adam_adsl),
    -  meta = NULL,
    -  charts = NULL,
    -  mapping = NULL,
    -  autoMapping = TRUE,
    -  filterDomain = "dm",
    -  chartSettingsPaths = NULL,
    -  runNow = TRUE
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    domainData

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    meta

    data frame containing the metadata for use in the app. If no metadata is provided, metatdata is generated by makeMeta().

    charts

    list of charts in the format produced by safetyGraphics::makeChartConfig()

    mapping

    list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    autoMapping

    boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the mapping parameter overwrite automatically generated mappings when both are found. Defaults to true.

    filterDomain

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    chartSettingsPaths

    path(s) where customization functions are saved relative to your working directory. All charts can have initialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.

    runNow

    Should the shiny app object created be run directly? Helpful when writing functions to dispatch to shinyapps, rsconnect, or shinyproxy.

    +
    +
    safetyGraphicsApp(
    +  domainData = list(labs = safetyData::adam_adlbc, aes = safetyData::adam_adae, dm =
    +    safetyData::adam_adsl),
    +  meta = NULL,
    +  charts = NULL,
    +  mapping = NULL,
    +  autoMapping = TRUE,
    +  filterDomain = "dm",
    +  chartSettingsPaths = NULL,
    +  runNow = TRUE
    +)
    +
    +
    +

    Arguments

    +
    domainData
    +

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    +
    meta
    +

    data frame containing the metadata for use in the app. If no metadata is provided, metatdata is generated by makeMeta().

    +
    charts
    +

    list of charts in the format produced by safetyGraphics::makeChartConfig()

    +
    mapping
    +

    list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    +
    autoMapping
    +

    boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the mapping parameter overwrite automatically generated mappings when both are found. Defaults to true.

    +
    filterDomain
    +

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    +
    chartSettingsPaths
    +

    path(s) where customization functions are saved relative to your working directory. All charts can have initialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.

    +
    runNow
    +

    Should the shiny app object created be run directly? Helpful when writing functions to dispatch to shinyapps, rsconnect, or shinyproxy.

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/safetyGraphicsInit.html b/docs/reference/safetyGraphicsInit.html index 9b25738f..db656b9c 100644 --- a/docs/reference/safetyGraphicsInit.html +++ b/docs/reference/safetyGraphicsInit.html @@ -1,67 +1,12 @@ - - - - - - - -App to select charts, load data and then initialize the core safetyGraphics app — safetyGraphicsInit • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -App to select charts, load data and then initialize the core safetyGraphics app — safetyGraphicsInit • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,55 +77,45 @@

    App to select charts, load data and then initialize the core safetyGraphics

    App to select charts, load data and then initialize the core safetyGraphics app

    -
    safetyGraphicsInit(
    -  charts = makeChartConfig(),
    -  delayTime = 1000,
    -  maxFileSize = NULL
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    charts

    chart object

    delayTime

    time (in ms) between drawing app UI and starting server. Default set to 1000 (1 second), but could need to be higher on slow machine.

    maxFileSize

    maximum file size in MB allowed for file upload

    +
    +
    safetyGraphicsInit(
    +  charts = makeChartConfig(),
    +  delayTime = 1000,
    +  maxFileSize = NULL
    +)
    +
    +
    +

    Arguments

    +
    charts
    +

    chart object

    +
    delayTime
    +

    time (in ms) between drawing app UI and starting server. Default set to 1000 (1 second), but could need to be higher on slow machine.

    +
    maxFileSize
    +

    maximum file size in MB allowed for file upload

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/safetyGraphicsServer.html b/docs/reference/safetyGraphicsServer.html index 6d645ab0..04fef849 100644 --- a/docs/reference/safetyGraphicsServer.html +++ b/docs/reference/safetyGraphicsServer.html @@ -1,67 +1,12 @@ - - - - - - - -Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsServer • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsServer • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,80 +77,60 @@

    Server for core safetyGraphics app including Home, Mapping, Filter, Charts a

    This function returns a server function suitable for use in shiny::runApp()

    -
    safetyGraphicsServer(
    -  input,
    -  output,
    -  session,
    -  meta,
    -  mapping,
    -  domainData,
    -  charts,
    -  filterDomain
    -)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    meta

    data frame containing the metadata for use in the app.

    mapping

    current mapping

    domainData

    named list of data.frames to be loaded in to the app.

    charts

    list of charts to include in the app

    filterDomain

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    +
    +
    safetyGraphicsServer(
    +  input,
    +  output,
    +  session,
    +  meta,
    +  mapping,
    +  domainData,
    +  charts,
    +  filterDomain
    +)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    meta
    +

    data frame containing the metadata for use in the app.

    +
    mapping
    +

    current mapping

    +
    domainData
    +

    named list of data.frames to be loaded in to the app.

    +
    charts
    +

    list of charts to include in the app

    +
    filterDomain
    +

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/safetyGraphicsUI.html b/docs/reference/safetyGraphicsUI.html index 636fbadc..3ad2244c 100644 --- a/docs/reference/safetyGraphicsUI.html +++ b/docs/reference/safetyGraphicsUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsUI • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,59 +77,45 @@

    UI for the core safetyGraphics app including Home, Mapping, Filter, Charts a

    UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

    -
    safetyGraphicsUI(id, meta, domainData, mapping, standards)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    id

    module ID

    meta

    data frame containing the metadata for use in the app.

    domainData

    named list of data.frames to be loaded in to the app.

    mapping

    data.frame specifying the initial values for each data mapping. If no mapping is provided, the app will attempt to generate one via detectStandard()

    standards

    a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard.

    +
    +
    safetyGraphicsUI(id, meta, domainData, mapping, standards)
    +
    +
    +

    Arguments

    +
    id
    +

    module ID

    +
    meta
    +

    data frame containing the metadata for use in the app.

    +
    domainData
    +

    named list of data.frames to be loaded in to the app.

    +
    mapping
    +

    data.frame specifying the initial values for each data mapping. If no mapping is provided, the app will attempt to generate one via detectStandard()

    +
    standards
    +

    a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard.

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/setMappingListValue.html b/docs/reference/setMappingListValue.html index 0aae6469..a42e8161 100644 --- a/docs/reference/setMappingListValue.html +++ b/docs/reference/setMappingListValue.html @@ -1,67 +1,12 @@ - - - - - - - -Set the value for a given named parameter — setMappingListValue • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Set the value for a given named parameter — setMappingListValue • safetyGraphics - + + - - - -
    -
    - -
    - -
    +
    @@ -141,68 +77,60 @@

    Set the value for a given named parameter

    Sets the value for a named parameter (key) to given value in a list (settings)

    -
    setMappingListValue(key, value, settings, forceCreate = FALSE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    key

    a list defining the position of parameter in the settings object.

    value

    the value to set

    settings

    The settings list used to generate a chart like eDISH()

    forceCreate

    Specifies whether the function should create a new list() when none exisits. This most commonly occurs when deeply nested objects.

    - -

    Value

    +
    +
    setMappingListValue(key, value, settings, forceCreate = FALSE)
    +
    +
    +

    Arguments

    +
    key
    +

    a list defining the position of parameter in the settings object.

    +
    value
    +

    the value to set

    +
    settings
    +

    The settings list used to generate a chart like eDISH()

    +
    forceCreate
    +

    Specifies whether the function should create a new list() when none exisits. This most commonly occurs when deeply nested objects.

    +
    +
    +

    Value

    the updated settings object

    +
    -

    Examples

    -
    testSet<-list(a=list(b="myValue")) -safetyGraphics:::setMappingListValue(key=list("a","b"), value="notMyValue", settings=testSet) -
    #> $a -#> $a$b -#> [1] "notMyValue" -#> -#>
    #returns list(a=list(b="notMyValue"))) - -
    +
    +

    Examples

    +
    testSet<-list(a=list(b="myValue"))
    +safetyGraphics:::setMappingListValue(key=list("a","b"), value="notMyValue", settings=testSet) 
    +#> $a
    +#> $a$b
    +#> [1] "notMyValue"
    +#> 
    +#> 
    +#returns list(a=list(b="notMyValue")))
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsCharts.html b/docs/reference/settingsCharts.html index 30add4bf..e13b6e39 100644 --- a/docs/reference/settingsCharts.html +++ b/docs/reference/settingsCharts.html @@ -1,67 +1,12 @@ - - - - - - - -Server for settings tab showing details for the charts loaded in the app — settingsCharts • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for settings tab showing details for the charts loaded in the app — settingsCharts • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,55 +77,43 @@

    Server for settings tab showing details for the charts loaded in the app

    Server for settings tab showing details for the charts loaded in the app

    -
    settingsCharts(input, output, session, charts)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    charts

    list data frame summarizing the charts

    +
    +
    settingsCharts(input, output, session, charts)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    charts
    +

    list data frame summarizing the charts

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsChartsUI.html b/docs/reference/settingsChartsUI.html index 1d496cbd..0ffd7613 100644 --- a/docs/reference/settingsChartsUI.html +++ b/docs/reference/settingsChartsUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for settings tab showing details for the charts loaded in the app — settingsChartsUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for settings tab showing details for the charts loaded in the app — settingsChartsUI • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,43 +77,37 @@

    UI for settings tab showing details for the charts loaded in the app

    UI for settings tab showing details for the charts loaded in the app

    -
    settingsChartsUI(id)
    - -

    Arguments

    - - - - - - -
    id

    module id

    +
    +
    settingsChartsUI(id)
    +
    +
    +

    Arguments

    +
    id
    +

    module id

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsCode.html b/docs/reference/settingsCode.html index 1c06d13e..88b9ca4a 100644 --- a/docs/reference/settingsCode.html +++ b/docs/reference/settingsCode.html @@ -1,67 +1,12 @@ - - - - - - - -Server for settings tab providing code to re-start the app with current data/settings — settingsCode • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for settings tab providing code to re-start the app with current data/settings — settingsCode • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,63 +77,47 @@

    Server for settings tab providing code to re-start the app with current data

    Server for settings tab providing code to re-start the app with current data/settings

    -
    settingsCode(input, output, session, mapping, charts, domainData)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    mapping

    mapping

    charts

    charts

    domainData

    data list

    +
    +
    settingsCode(input, output, session, mapping, charts, domainData)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    mapping
    +

    mapping

    +
    charts
    +

    charts

    +
    domainData
    +

    data list

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsCodeUI.html b/docs/reference/settingsCodeUI.html index 49a12d75..32b89bf1 100644 --- a/docs/reference/settingsCodeUI.html +++ b/docs/reference/settingsCodeUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for settings tab providing code to re-start the app with current data/settings — settingsCodeUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for settings tab providing code to re-start the app with current data/settings — settingsCodeUI • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,43 +77,37 @@

    UI for settings tab providing code to re-start the app with current data/set

    UI for settings tab providing code to re-start the app with current data/settings

    -
    settingsCodeUI(id)
    - -

    Arguments

    - - - - - - -
    id

    module ID

    +
    +
    settingsCodeUI(id)
    +
    +
    +

    Arguments

    +
    id
    +

    module ID

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsData.html b/docs/reference/settingsData.html index 27b3caff..4bb8b565 100644 --- a/docs/reference/settingsData.html +++ b/docs/reference/settingsData.html @@ -1,67 +1,12 @@ - - - - - - - -Server for settings tab showing current data — settingsData • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for settings tab showing current data — settingsData • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,55 +77,43 @@

    Server for settings tab showing current data

    Server for settings tab showing current data

    -
    settingsData(input, output, session, domains)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    domains

    named list of the data.frames for each domain

    +
    +
    settingsData(input, output, session, domains)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    domains
    +

    named list of the data.frames for each domain

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsDataUI.html b/docs/reference/settingsDataUI.html index 41b488fa..42619ca3 100644 --- a/docs/reference/settingsDataUI.html +++ b/docs/reference/settingsDataUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for settings tab showing current data — settingsDataUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for settings tab showing current data — settingsDataUI • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,43 +77,37 @@

    UI for settings tab showing current data

    UI for settings tab showing current data

    -
    settingsDataUI(id)
    - -

    Arguments

    - - - - - - -
    id

    module id

    +
    +
    settingsDataUI(id)
    +
    +
    +

    Arguments

    +
    id
    +

    module id

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsMapping.html b/docs/reference/settingsMapping.html index 54bb585b..457fd910 100644 --- a/docs/reference/settingsMapping.html +++ b/docs/reference/settingsMapping.html @@ -1,67 +1,12 @@ - - - - - - - -Server for settings tab showing current mapping — settingsMapping • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for settings tab showing current mapping — settingsMapping • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,59 +77,45 @@

    Server for settings tab showing current mapping

    Server for settings tab showing current mapping

    -
    settingsMapping(input, output, session, metadata, mapping)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    metadata

    Data mapping metadata used for initial loading of app

    mapping

    reactive data frame representing the current metadata mapping. columns = "domain", "text_id" and "current"

    +
    +
    settingsMapping(input, output, session, metadata, mapping)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    metadata
    +

    Data mapping metadata used for initial loading of app

    +
    mapping
    +

    reactive data frame representing the current metadata mapping. columns = "domain", "text_id" and "current"

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsMappingUI.html b/docs/reference/settingsMappingUI.html index 101839c3..e8ea6262 100644 --- a/docs/reference/settingsMappingUI.html +++ b/docs/reference/settingsMappingUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for settings tab showing current mapping — settingsMappingUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for settings tab showing current mapping — settingsMappingUI • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,43 +77,37 @@

    UI for settings tab showing current mapping

    UI for settings tab showing current mapping

    -
    settingsMappingUI(id)
    - -

    Arguments

    - - - - - - -
    id

    module id

    +
    +
    settingsMappingUI(id)
    +
    +
    +

    Arguments

    +
    id
    +

    module id

    +
    +
    -
    - +

    - - + + diff --git a/docs/reference/settingsTab.html b/docs/reference/settingsTab.html index ac486880..7186a2ee 100644 --- a/docs/reference/settingsTab.html +++ b/docs/reference/settingsTab.html @@ -1,67 +1,12 @@ - - - - - - - -Server for the setting page — settingsTab • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Server for the setting page — settingsTab • safetyGraphics - - - - + + -
    -
    - -
    - -
    +
    @@ -141,67 +77,49 @@

    Server for the setting page

    Server for the setting page

    -
    settingsTab(input, output, session, domains, metadata, mapping, charts)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    input

    Shiny input object

    output

    Shiny output object

    session

    Shiny session object

    domains

    domains

    metadata

    metadata

    mapping

    mapping

    charts

    charts

    +
    +
    settingsTab(input, output, session, domains, metadata, mapping, charts)
    +
    +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    domains
    +

    domains

    +
    metadata
    +

    metadata

    +
    mapping
    +

    mapping

    +
    charts
    +

    charts

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/settingsTabUI.html b/docs/reference/settingsTabUI.html index ee80bc68..a91efbdf 100644 --- a/docs/reference/settingsTabUI.html +++ b/docs/reference/settingsTabUI.html @@ -1,67 +1,12 @@ - - - - - - - -UI for the settings tab — settingsTabUI • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -UI for the settings tab — settingsTabUI • safetyGraphics + + - - - - -
    -
    - -
    - -
    +
    @@ -141,43 +77,37 @@

    UI for the settings tab

    UI for the settings tab

    -
    settingsTabUI(id)
    - -

    Arguments

    - - - - - - -
    id

    module ID

    +
    +
    settingsTabUI(id)
    +
    +
    +

    Arguments

    +
    id
    +

    module ID

    +
    +
    -
    - +
    - - + + diff --git a/docs/reference/textKeysToList.html b/docs/reference/textKeysToList.html index cb593473..47885c93 100644 --- a/docs/reference/textKeysToList.html +++ b/docs/reference/textKeysToList.html @@ -1,67 +1,12 @@ - - - - - - - -Helper function to convert keys from text to nested lists — textKeysToList • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Helper function to convert keys from text to nested lists — textKeysToList • safetyGraphics - - + + - - -
    -
    - -
    - -
    +
    @@ -141,70 +77,69 @@

    Helper function to convert keys from text to nested lists

    Convert settings keys from text vectors (using the "--" delimiter) to a list of lists

    -
    textKeysToList(textKeys)
    - -

    Arguments

    - - - - - - -
    textKeys

    a list (or vector) of character keys using the "--" delimiter to indicate hierarchy

    - -

    Value

    +
    +
    textKeysToList(textKeys)
    +
    +
    +

    Arguments

    +
    textKeys
    +

    a list (or vector) of character keys using the "--" delimiter to indicate hierarchy

    +
    +
    +

    Value

    A list of unnamed lists, with position in the nested list indicating hierarchy

    +
    -

    Examples

    -
    safetyGraphics:::textKeysToList("id_col") -
    #> [[1]] -#> [[1]][[1]] -#> [1] "id_col" -#> -#>
    #list(list("id_col")) - -#list(list("id_col"),list("measure_col","label")) -safetyGraphics:::textKeysToList(c("id_col","measure_col--label")) -
    #> [[1]] -#> [[1]][[1]] -#> [1] "id_col" -#> -#> -#> [[2]] -#> [[2]][[1]] -#> [1] "measure_col" -#> -#> [[2]][[2]] -#> [1] "label" -#> -#>
    -
    +
    +

    Examples

    +
    safetyGraphics:::textKeysToList("id_col") 
    +#> [[1]]
    +#> [[1]][[1]]
    +#> [1] "id_col"
    +#> 
    +#> 
    +#list(list("id_col"))
    +
    +#list(list("id_col"),list("measure_col","label"))
    +safetyGraphics:::textKeysToList(c("id_col","measure_col--label")) 
    +#> [[1]]
    +#> [[1]][[1]]
    +#> [1] "id_col"
    +#> 
    +#> 
    +#> [[2]]
    +#> [[2]][[1]]
    +#> [1] "measure_col"
    +#> 
    +#> [[2]][[2]]
    +#> [1] "label"
    +#> 
    +#> 
    +
    +
    +
    +
    -
    - +
    - - + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 0d6376e5..b36fdc34 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,14 +1,68 @@ + + https://safetygraphics.github.io/safetyGraphics/404.html + + + https://safetygraphics.github.io/safetyGraphics/LICENSE-text.html + + + https://safetygraphics.github.io/safetyGraphics/LICENSE.html + + + https://safetygraphics.github.io/safetyGraphics/articles/Cookbook.html + + + https://safetygraphics.github.io/safetyGraphics/articles/TechnicalFAQ.html + + + https://safetygraphics.github.io/safetyGraphics/articles/chartConfiguration.html + + + https://safetygraphics.github.io/safetyGraphics/articles/customWorkflows.html + + + https://safetygraphics.github.io/safetyGraphics/articles/index.html + + + https://safetygraphics.github.io/safetyGraphics/articles/intro.html + + + https://safetygraphics.github.io/safetyGraphics/articles/shinyUserGuide.html + + + https://safetygraphics.github.io/safetyGraphics/authors.html + https://safetygraphics.github.io/safetyGraphics/index.html + + https://safetygraphics.github.io/safetyGraphics/news/index.html + https://safetygraphics.github.io/safetyGraphics/reference/SafetyGraphics.html + + https://safetygraphics.github.io/safetyGraphics/reference/addChart.html + + + https://safetygraphics.github.io/safetyGraphics/reference/addSetting.html + + + https://safetygraphics.github.io/safetyGraphics/reference/adlbc.html + https://safetygraphics.github.io/safetyGraphics/reference/app_startup.html + + https://safetygraphics.github.io/safetyGraphics/reference/chartRenderer-shiny.html + + + https://safetygraphics.github.io/safetyGraphics/reference/chartRenderer.html + + + https://safetygraphics.github.io/safetyGraphics/reference/chartsMetadata.html + https://safetygraphics.github.io/safetyGraphics/reference/chartsNav.html @@ -18,6 +72,21 @@ https://safetygraphics.github.io/safetyGraphics/reference/chartsTabUI.html + + https://safetygraphics.github.io/safetyGraphics/reference/checkColumn.html + + + https://safetygraphics.github.io/safetyGraphics/reference/checkField.html + + + https://safetygraphics.github.io/safetyGraphics/reference/checkNumeric.html + + + https://safetygraphics.github.io/safetyGraphics/reference/checkRequired.html + + + https://safetygraphics.github.io/safetyGraphics/reference/createChart.html + https://safetygraphics.github.io/safetyGraphics/reference/detectStandard.html @@ -36,6 +105,24 @@ https://safetygraphics.github.io/safetyGraphics/reference/generateMappingList.html + + https://safetygraphics.github.io/safetyGraphics/reference/generateSettings.html + + + https://safetygraphics.github.io/safetyGraphics/reference/generateShell.html + + + https://safetygraphics.github.io/safetyGraphics/reference/getRequiredSettings.html + + + https://safetygraphics.github.io/safetyGraphics/reference/getSettingKeys.html + + + https://safetygraphics.github.io/safetyGraphics/reference/getSettingValue.html + + + https://safetygraphics.github.io/safetyGraphics/reference/getSettingsMetadata.html + https://safetygraphics.github.io/safetyGraphics/reference/hasColumn.html @@ -48,6 +135,9 @@ https://safetygraphics.github.io/safetyGraphics/reference/homeTabUI.html + + https://safetygraphics.github.io/safetyGraphics/reference/index.html + https://safetygraphics.github.io/safetyGraphics/reference/loadCharts.html @@ -102,9 +192,18 @@ https://safetygraphics.github.io/safetyGraphics/reference/mappingTabUI.html + + https://safetygraphics.github.io/safetyGraphics/reference/meta.html + https://safetygraphics.github.io/safetyGraphics/reference/prepareChart.html + + https://safetygraphics.github.io/safetyGraphics/reference/removeCharts.html + + + https://safetygraphics.github.io/safetyGraphics/reference/removeSettings.html + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsApp.html @@ -120,6 +219,9 @@ https://safetygraphics.github.io/safetyGraphics/reference/setMappingListValue.html + + https://safetygraphics.github.io/safetyGraphics/reference/setSettingsValue.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsCharts.html @@ -144,6 +246,9 @@ https://safetygraphics.github.io/safetyGraphics/reference/settingsMappingUI.html + + https://safetygraphics.github.io/safetyGraphics/reference/settingsMetadata.html + https://safetygraphics.github.io/safetyGraphics/reference/settingsTab.html @@ -151,18 +256,18 @@ https://safetygraphics.github.io/safetyGraphics/reference/settingsTabUI.html - https://safetygraphics.github.io/safetyGraphics/reference/textKeysToList.html + https://safetygraphics.github.io/safetyGraphics/reference/standardsMetadata.html - https://safetygraphics.github.io/safetyGraphics/articles/Cookbook.html + https://safetygraphics.github.io/safetyGraphics/reference/textKeysToList.html - https://safetygraphics.github.io/safetyGraphics/articles/TechnicalFAQ.html + https://safetygraphics.github.io/safetyGraphics/reference/trimData.html - https://safetygraphics.github.io/safetyGraphics/articles/chartConfiguration.html + https://safetygraphics.github.io/safetyGraphics/reference/trimSettings.html - https://safetygraphics.github.io/safetyGraphics/articles/intro.html + https://safetygraphics.github.io/safetyGraphics/reference/validateSettings.html diff --git a/vignettes/chartConfiguration.Rmd b/vignettes/chartConfiguration.Rmd index 49c18881..e51e8046 100644 --- a/vignettes/chartConfiguration.Rmd +++ b/vignettes/chartConfiguration.Rmd @@ -314,6 +314,7 @@ Alternatively, metadata can be saved as a data object in the `chart$package` nam The diagram above summarizes the various components of the safetyGraphics charting framework: + - The `safetyGraphicsApp()` function allows users to specify which charts to include in the shiny app via the `charts` parameter, which expects a `list` of charts. - Each item in `charts` is itself defined as a `list` that provides configuration details for a single chart. These configuration lists have several required parameters, which are described in the technical specification below. - Configuration lists are typically saved as YAML files, but can be also be loaded directly as list objects as shown in the Hello World example above. @@ -322,6 +323,7 @@ The diagram above summarizes the various components of the safetyGraphics charti ## Chart Specification Each item in the `charts` list should be a list() with the following parameters: + - `env`: Environment for the chart. Must be set to "safetyGraphics" or the chart is dropped. Type: *character*. **Required** - `name`: Name of the chart. Type: *character*. **Required** - `type:`: Type of chart. Valid options are: "plot","htmlwidget","html","table" and "module". Type: *character*. **Required** diff --git a/vignettes/intro.Rmd b/vignettes/intro.Rmd index 33b02bf5..b08e4562 100644 --- a/vignettes/intro.Rmd +++ b/vignettes/intro.Rmd @@ -108,6 +108,7 @@ Use the `maxFileSize` option to load data sets larger than 5 mb in `safetyGraphi # Additional Resources Several additional vignettes are available for more advanced topics: + - [Chart Configuration Vignette](ChartConfiguration.html) - details about the charting process including technical specifications and step-by-step instructions - [Cookbook Vignette](Cookbook.html) - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios - [Technical FAQ Vignette](TechnicalFAQ.html) - vignette discussing security, validation and other technical issues @@ -149,6 +150,7 @@ safetyGraphicsApp() #or safetyGraphicsInit() Since the `safetyGraphics` framework supports adding custom charts (that may have custom settings), there are no universal data requirements for the app. However, the charts included by default version of the app are built to share requirements whenever possible. These requirements are captured in an included metadata file called `safetyGraphics::meta`. The most basic requirements for the 3 default domains are: + - **Lab results** (`labs`) domain - Expects one record per person per visit per lab measurement with columns for: Participant ID, lab result, lab name, lower limit of normal, upper limit of normal, study day, study visit (numeric), study visit (character). See `safetyGraphics::meta %>% filter(domain=="labs")` for additional details and optional columns used by some charts. - **Adverse Event** (`aes`) domain - Expects one record per adverse event with columns for: Participant ID, AE Sequence, Study Day, AE Start day, AE end day, AE preferred term and AE body system. See `safetyGraphics::meta %>% filter(domain=="aes")` - **Demographics** (`dm`) domain - Expects one record per person with columns for: Participant ID, Sex, Race, Age and Study Treatment (optional) . See `safetyGraphics::meta %>% filter(domain=="dm")` for additional details. \ No newline at end of file From 15b074c48fc8f5668056cde624f1db78e345eead Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sat, 2 Apr 2022 10:29:13 -0400 Subject: [PATCH 37/41] prep for v2.1 release --- DESCRIPTION | 2 +- NAMESPACE | 3 +++ NEWS.md | 7 +++++++ R/makeMeta.R | 2 ++ vignettes/chartConfiguration.Rmd | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index af322d79..6041284b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -39,7 +39,7 @@ Imports: rclipboard (>= 0.1.3), rlang (>= 0.4.11), safetyData (>= 1.0.0), - safetyCharts (>= 0.2), + safetyCharts (>= 0.3), shiny (>= 1.6.0), shinyjs (>= 2.0.0), sortable (>= 0.4.4), diff --git a/NAMESPACE b/NAMESPACE index 7542ed76..61095cdd 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,5 +1,6 @@ # Generated by roxygen2: do not edit by hand +export("%>%") export(app_startup) export(chartsNav) export(chartsTab) @@ -49,10 +50,12 @@ import(datamods) import(dplyr) import(purrr) import(rclipboard) +import(safetyCharts) import(safetyData) import(shiny) import(yaml) importFrom(DT,renderDT) +importFrom(magrittr,"%>%") importFrom(purrr,keep) importFrom(purrr,map) importFrom(purrr,map2) diff --git a/NEWS.md b/NEWS.md index d3c75d20..e48c1077 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,10 @@ +# safetyGraphics v2.1.0 + +This release focuses on updates the safetyGraphics metadata framework: + +- The default metadata table has been migrated to safetyCharts and modularized. In short,`safetyGraphics::meta` is now saved as `safetyCharts::meta_aes`, `safetyCharts::meta_labs` and `safetyCharts::meta_dm`. +- A new `makeMeta` function has been created and integrated in to the default workflow for the Shiny app. `makeMeta` provides a much more flexible framework for creating and storing metadata. See `?makeMeta` and the Cookbook and Chart Configuration vignettes for more details. + # safetyGraphics v2.0.0 Version 2 of {safetyGraphics} is a major update that adds the following features: diff --git a/R/makeMeta.R b/R/makeMeta.R index d26e9a82..430f098b 100644 --- a/R/makeMeta.R +++ b/R/makeMeta.R @@ -23,6 +23,8 @@ #' } #' #' @importFrom tidyr replace_na starts_with +#' @import safetyCharts +#' #' @export makeMeta <- function(charts){ diff --git a/vignettes/chartConfiguration.Rmd b/vignettes/chartConfiguration.Rmd index e51e8046..d8f5aa6a 100644 --- a/vignettes/chartConfiguration.Rmd +++ b/vignettes/chartConfiguration.Rmd @@ -155,7 +155,7 @@ If you look closely at the `spaghettiPlot()` code above, you'll noticed some det - The references to `settings` use parameters that are defined on the mapping tab. Behind the scenes, these are defined in the `safetyGraphics::meta`. - The `spaghettiPlot` function is referenced in the `main` item the YAML `workflow`. This tells the app which function to use to draw the chart. - We're using the `.data[[]]` pronoun in the chart function to access columns in the data based on the current settings. See these references for a lot more detail about functional programming in the tidyverse: - - [Using ggplot2 in packages](https://cran.r-project.org/web/packages/ggplot2/vignettes/ggplot2-in-packages.html) + - [Using ggplot2 in packages](https://cran.r-project.org/package=ggplot2/vignettes/ggplot2-in-packages.html) - [Programming with dplyr](https://dplyr.tidyverse.org/articles/programming.html) - [Functional programming chapters in Advanced R](https://adv-r.hadley.nz/fp.html) These details allow users to dynamically define data attributes for any labs data set, allowing the chart to be reused across many different types of data. From d6660d34e6d3223abaa176d71ba9cfeb823b87aa Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sat, 2 Apr 2022 10:29:33 -0400 Subject: [PATCH 38/41] add util-pipe --- R/util-pipe.R | 11 +++++++++++ man/pipe.Rd | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 R/util-pipe.R create mode 100644 man/pipe.Rd diff --git a/R/util-pipe.R b/R/util-pipe.R new file mode 100644 index 00000000..f3695be8 --- /dev/null +++ b/R/util-pipe.R @@ -0,0 +1,11 @@ +#' Pipe operator +#' +#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. +#' +#' @name %>% +#' @rdname pipe +#' @keywords internal +#' @export +#' @importFrom magrittr %>% +#' @usage lhs \%>\% rhs +NULL \ No newline at end of file diff --git a/man/pipe.Rd b/man/pipe.Rd new file mode 100644 index 00000000..12dafe77 --- /dev/null +++ b/man/pipe.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/util-pipe.R +\name{\%>\%} +\alias{\%>\%} +\title{Pipe operator} +\usage{ +lhs \%>\% rhs +} +\description{ +See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. +} +\keyword{internal} From a2dc98c8fe69085773e1bf15ba581a3663a01e72 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Sat, 2 Apr 2022 10:47:40 -0400 Subject: [PATCH 39/41] remove link in vignette. rebuild pkgdown --- NEWS.md | 2 +- docs/articles/Cookbook.html | 10 +-- docs/articles/TechnicalFAQ.html | 4 +- docs/articles/chartConfiguration.html | 8 +- docs/articles/intro.html | 2 +- docs/news/index.html | 8 +- docs/pkgdown.yml | 2 +- docs/reference/pipe.html | 108 ++++++++++++++++++++++++++ docs/sitemap.xml | 3 + vignettes/TechnicalFAQ.Rmd | 2 +- 10 files changed, 133 insertions(+), 16 deletions(-) create mode 100644 docs/reference/pipe.html diff --git a/NEWS.md b/NEWS.md index e48c1077..9feaf90a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,7 +16,7 @@ Version 2 of {safetyGraphics} is a major update that adds the following features - New "Config" tab summarizing app configuration - Created new `safetyGraphicsInit()` app with a simple UI that can initialize the app with custom data/charts -For more details, see the fully updated vingettes. +For more details, see the fully updated vignettes. # safetyGraphics v1.1.0 diff --git a/docs/articles/Cookbook.html b/docs/articles/Cookbook.html index fe4fe789..ef26cda7 100644 --- a/docs/articles/Cookbook.html +++ b/docs/articles/Cookbook.html @@ -96,7 +96,7 @@

    Cookbook

    Jeremy Wildfire

    -

    2022-03-24

    +

    2022-04-02

    Source: vignettes/Cookbook.Rmd @@ -182,7 +182,7 @@

    Example 4 - Loading other data f

    Example 5 - Non-standard data

    Next, let’s initialize the the app with non-standard data. {safetyGraphics} automatically detects AdAM and SDTM data when possible, but for non-standard data, the user must provide a data mapping. This can be done in the app using the data/mapping tab, or can be done when the app is initialized by passing a mapping list to safetyGraphicsApp(). For example:

    -
    notAdAM <- list(labs=safetyData::adam_adlbc %>% rename(id = USUBJID))
    +
    notAdAM <- list(labs=safetyData::adam_adlbc %>% rename(id = USUBJID))
     idMapping<- list(labs=list(id_col="id"))
     safetyGraphicsApp(domainData=notAdAM, mapping=idMapping)
    @@ -215,7 +215,7 @@

    Example 7 - Drop Unwanted ChartsUsers can also generate a list of charts and then drop charts that they don’t want to include. For example, if you wanted to drop charts with type of “htmlwidgets” you could run this code.

    library(purrr)
     charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    -notWidgets <- charts %>% purrr::keep(~.x$type != "htmlwidget")
    +notWidgets <- charts %>% purrr::keep(~.x$type != "htmlwidget")
     safetyGraphicsApp(charts=notWidgets)

    @@ -282,7 +282,7 @@

    Example 11 - Cr ~text_key, ~domain, ~label, ~standard_hello, ~description, "x_col", "hello", "x position", "x", "x position for points in hello world chart", "y_col", "hello", "y position", "y", "y position for points in hello world chart" -) %>% mutate( +) %>% mutate( col_key = text_key, type="column" ) @@ -339,7 +339,7 @@

    Example 13 - Create an ECG "visitn_col", "custom_ecg", "Visit number column", "Visit number variable name", "ATPTN", NA, "period_col", "custom_ecg", "Period column", "Period variable name", "APERIOD", NA, "unit_col", "custom_ecg", "Unit column", "Unit of measure variable name", "AVALU", "EGSTRESU" -) %>% mutate( +) %>% mutate( col_key = text_key, type="column" ) diff --git a/docs/articles/TechnicalFAQ.html b/docs/articles/TechnicalFAQ.html index 0143e58a..6fa45122 100644 --- a/docs/articles/TechnicalFAQ.html +++ b/docs/articles/TechnicalFAQ.html @@ -96,7 +96,7 @@

    Technical FAQ

    Jeremy Wildfire

    -

    2022-03-24

    +

    2022-04-02

    Source: vignettes/TechnicalFAQ.Rmd @@ -190,7 +190,7 @@

    Is data loaded in to the safetyGraphics app secure?

    Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package.

    -

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5, 6) - that could help to facilitate these discussion.

    +

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5) - that could help to facilitate these discussion.

    Q: How can the safetyGraphics app be shared? diff --git a/docs/articles/chartConfiguration.html b/docs/articles/chartConfiguration.html index 46bd3c10..d9143910 100644 --- a/docs/articles/chartConfiguration.html +++ b/docs/articles/chartConfiguration.html @@ -96,7 +96,7 @@

    Chart Configuration

    Jeremy Wildfire

    -

    2022-03-24

    +

    2022-04-02

    Source: vignettes/chartConfiguration.Rmd @@ -197,7 +197,7 @@

    Example 2 - Static Outlier Explorer } spaghettiPlot( - safetyData::sdtm_lb %>% + safetyData::sdtm_lb %>% filter(LBTEST %in% c("Albumin","Bilirubin","Calcium","Chloride")), settings ) @@ -228,7 +228,7 @@

    Example 2 - Static Outlier Explorer
  • The spaghettiPlot function is referenced in the main item the YAML workflow. This tells the app which function to use to draw the chart.
  • We’re using the .data[[]] pronoun in the chart function to access columns in the data based on the current settings. See these references for a lot more detail about functional programming in the tidyverse:
      -
    • Using ggplot2 in packages
    • +
    • Using ggplot2 in packages
    • Programming with dplyr
    • Functional programming chapters in Advanced R These details allow users to dynamically define data attributes for any labs data set, allowing the chart to be reused across many different types of data.
    • @@ -343,7 +343,7 @@

      Example 5 - Adding a Ch "visitn_col", "custom_ecg", "Visit number column", "Visit number variable name", "ATPTN", NA, "period_col", "custom_ecg", "Period column", "Period variable name", "APERIOD", NA, "unit_col", "custom_ecg", "Unit column", "Unit of measure variable name", "AVALU", "EGSTRESU" -) %>% mutate( +) %>% mutate( col_key = text_key, type="column" ) diff --git a/docs/articles/intro.html b/docs/articles/intro.html index 081db8f2..fe33683f 100644 --- a/docs/articles/intro.html +++ b/docs/articles/intro.html @@ -96,7 +96,7 @@

      Intro to Shiny App

      Jeremy Wildfire

      -

      2022-03-24

      +

      2022-04-02

      Source: vignettes/intro.Rmd diff --git a/docs/news/index.html b/docs/news/index.html index 2bf39a34..d6b6daa8 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -72,6 +72,12 @@

      Changelog

      Source: NEWS.md
  • +
    + +

    This release focuses on updates the safetyGraphics metadata framework:

    +
    • The default metadata table has been migrated to safetyCharts and modularized. In short,safetyGraphics::meta is now saved as safetyCharts::meta_aes, safetyCharts::meta_labs and safetyCharts::meta_dm.
    • +
    • A new makeMeta function has been created and integrated in to the default workflow for the Shiny app. makeMeta provides a much more flexible framework for creating and storing metadata. See ?makeMeta and the Cookbook and Chart Configuration vignettes for more details.
    • +

    Version 2 of {safetyGraphics} is a major update that adds the following features:

    @@ -81,7 +87,7 @@
    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index bf67a70e..b78bf358 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -6,7 +6,7 @@ articles: TechnicalFAQ: TechnicalFAQ.html chartConfiguration: chartConfiguration.html intro: intro.html -last_built: 2022-03-24T18:18Z +last_built: 2022-04-02T14:46Z urls: reference: https://safetygraphics.github.io/safetyGraphics/reference article: https://safetygraphics.github.io/safetyGraphics/articles diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html new file mode 100644 index 00000000..7efcc085 --- /dev/null +++ b/docs/reference/pipe.html @@ -0,0 +1,108 @@ + +Pipe operator — %>% • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    See magrittr::%>% for details.

    +
    + +
    +
    lhs %>% rhs
    +
    + + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index b36fdc34..8fc6cc47 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -195,6 +195,9 @@ https://safetygraphics.github.io/safetyGraphics/reference/meta.html + + https://safetygraphics.github.io/safetyGraphics/reference/pipe.html + https://safetygraphics.github.io/safetyGraphics/reference/prepareChart.html diff --git a/vignettes/TechnicalFAQ.Rmd b/vignettes/TechnicalFAQ.Rmd index d55a99b1..33733729 100644 --- a/vignettes/TechnicalFAQ.Rmd +++ b/vignettes/TechnicalFAQ.Rmd @@ -96,7 +96,7 @@ More detail is provided in the [Loading data section of the Introductory vignett Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package. Just like the discussion regarding [Validation and Quality Control](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ.html#validation-quality-control-and-testing), data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general ([1](https://www.hhs.gov/ohrp/sites/default/files/report-privacy-and-health-10-31-19.pdf), [2](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4943495/), [3](https://www.d-wise.com/blog/detailing-the-de-identification-and-data-transparency-boundaries-of-ema-policy-70-and-gdpr)) and discussing data security in shiny ([4](https://www.youtube.com/watch?v=5odJxZj9LE4), -[5](https://mastering-shiny.org/scaling-security.html#data), [6](https://support.rstudio.com/hc/en-us/articles/360042593974-R-and-R-Package-Security)) - that could help to facilitate these discussion. +[5](https://mastering-shiny.org/scaling-security.html#data)) - that could help to facilitate these discussion. ## Q: How can the safetyGraphics app be shared? From ab14c92a15ca845feda80cdb69a24acbe62b0783 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Fri, 8 Apr 2022 05:32:42 -0400 Subject: [PATCH 40/41] remove docs (full rebuild coming) --- _pkgdown.yml | 8 +- docs/404.html | 130 --- docs/LICENSE-text.html | 104 --- docs/LICENSE.html | 108 --- docs/articles/Cookbook.html | 390 --------- .../header-attrs-2.10/header-attrs.js | 12 - .../header-attrs-2.11/header-attrs.js | 12 - .../header-attrs-2.13/header-attrs.js | 12 - .../header-attrs-2.9/header-attrs.js | 12 - docs/articles/TechnicalFAQ.html | 260 ------ .../header-attrs-2.10/header-attrs.js | 12 - .../header-attrs-2.11/header-attrs.js | 12 - .../header-attrs-2.13/header-attrs.js | 12 - .../header-attrs-2.9/header-attrs.js | 12 - docs/articles/chartConfiguration.html | 521 ------------ .../header-attrs-2.10/header-attrs.js | 12 - .../header-attrs-2.11/header-attrs.js | 12 - .../header-attrs-2.13/header-attrs.js | 12 - .../header-attrs-2.9/header-attrs.js | 12 - docs/articles/customWorkflows.html | 576 -------------- docs/articles/index.html | 107 --- docs/articles/intro.html | 278 ------- .../header-attrs-2.10/header-attrs.js | 12 - .../header-attrs-2.11/header-attrs.js | 12 - .../header-attrs-2.13/header-attrs.js | 12 - .../header-attrs-2.9/header-attrs.js | 12 - docs/articles/shinyUserGuide.html | 357 --------- docs/authors.html | 143 ---- docs/bootstrap-toc.css | 60 -- docs/bootstrap-toc.js | 159 ---- docs/docsearch.css | 148 ---- docs/docsearch.js | 85 -- docs/index.html | 187 ----- docs/link.svg | 12 - docs/news/index.html | 130 --- docs/pkgdown.css | 384 --------- docs/pkgdown.js | 108 --- docs/pkgdown.yml | 13 - docs/reference/Rplot001.png | Bin 1011 -> 0 bytes docs/reference/SafetyGraphics.html | 111 --- docs/reference/addChart.html | 225 ------ docs/reference/addSetting.html | 238 ------ docs/reference/adlbc.html | 226 ------ docs/reference/app_startup.html | 141 ---- docs/reference/chartRenderer-shiny.html | 199 ----- docs/reference/chartRenderer.html | 220 ------ docs/reference/chartsMetadata.html | 188 ----- docs/reference/chartsNav.html | 115 --- docs/reference/chartsTab.html | 123 --- docs/reference/chartsTabUI.html | 115 --- docs/reference/checkColumn.html | 323 -------- docs/reference/checkField.html | 228 ------ docs/reference/checkNumeric.html | 243 ------ docs/reference/checkRequired.html | 272 ------- docs/reference/createChart.html | 189 ----- docs/reference/detectStandard.html | 337 -------- docs/reference/evaluateStandard.html | 217 ----- docs/reference/filterTab.html | 140 ---- docs/reference/filterTabChecks.html | 121 --- docs/reference/filterTabUI.html | 113 --- docs/reference/generateMappingList.html | 117 --- docs/reference/generateSettings.html | 739 ------------------ docs/reference/generateShell.html | 280 ------- docs/reference/getRequiredSettings.html | 216 ----- docs/reference/getSettingKeys.html | 295 ------- docs/reference/getSettingValue.html | 193 ----- docs/reference/getSettingsMetadata.html | 528 ------------- docs/reference/hasColumn.html | 128 --- docs/reference/hasField.html | 141 ---- docs/reference/homeTab.html | 117 --- docs/reference/homeTabUI.html | 113 --- docs/reference/index.html | 290 ------- docs/reference/loadCharts.html | 119 --- docs/reference/loadChartsUI.html | 115 --- docs/reference/loadData.html | 119 --- docs/reference/loadDataUI.html | 115 --- docs/reference/makeChartConfig.html | 139 ---- docs/reference/makeChartExport.html | 119 --- docs/reference/makeChartParams.html | 117 --- docs/reference/makeChartSummary.html | 117 --- docs/reference/makeMapping.html | 124 --- docs/reference/makeMeta.html | 156 ---- docs/reference/mappingColumn.html | 125 --- docs/reference/mappingColumnUI.html | 119 --- docs/reference/mappingDomain.html | 125 --- docs/reference/mappingDomainUI.html | 119 --- docs/reference/mappingSelect.html | 121 --- docs/reference/mappingSelectUI.html | 123 --- docs/reference/mappingTab.html | 125 --- docs/reference/mappingTabUI.html | 121 --- docs/reference/meta.html | 194 ----- docs/reference/pipe.html | 108 --- docs/reference/prepareChart.html | 117 --- docs/reference/removeCharts.html | 186 ----- docs/reference/removeSettings.html | 186 ----- docs/reference/safetyGraphicsApp.html | 137 ---- docs/reference/safetyGraphicsInit.html | 121 --- docs/reference/safetyGraphicsServer.html | 136 ---- docs/reference/safetyGraphicsUI.html | 121 --- docs/reference/setMappingListValue.html | 136 ---- docs/reference/setSettingsValue.html | 523 ------------- docs/reference/settingsCharts.html | 119 --- docs/reference/settingsChartsUI.html | 113 --- docs/reference/settingsCode.html | 123 --- docs/reference/settingsCodeUI.html | 113 --- docs/reference/settingsData.html | 119 --- docs/reference/settingsDataUI.html | 113 --- docs/reference/settingsMapping.html | 121 --- docs/reference/settingsMappingUI.html | 113 --- docs/reference/settingsMetadata.html | 198 ----- docs/reference/settingsTab.html | 125 --- docs/reference/settingsTabUI.html | 113 --- docs/reference/standardsMetadata.html | 183 ----- docs/reference/textKeysToList.html | 145 ---- docs/reference/trimData.html | 195 ----- docs/reference/trimSettings.html | 227 ------ docs/reference/validateSettings.html | 307 -------- docs/sitemap.xml | 276 ------- ...nfiguration.Rmd => ChartConfiguration.Rmd} | 0 vignettes/Cookbook.Rmd | 2 +- vignettes/{intro.Rmd => Intro.Rmd} | 2 +- vignettes/TechnicalFAQ.Rmd | 10 +- 122 files changed, 11 insertions(+), 18590 deletions(-) delete mode 100644 docs/404.html delete mode 100644 docs/LICENSE-text.html delete mode 100644 docs/LICENSE.html delete mode 100644 docs/articles/Cookbook.html delete mode 100644 docs/articles/Cookbook_files/header-attrs-2.10/header-attrs.js delete mode 100644 docs/articles/Cookbook_files/header-attrs-2.11/header-attrs.js delete mode 100644 docs/articles/Cookbook_files/header-attrs-2.13/header-attrs.js delete mode 100644 docs/articles/Cookbook_files/header-attrs-2.9/header-attrs.js delete mode 100644 docs/articles/TechnicalFAQ.html delete mode 100644 docs/articles/TechnicalFAQ_files/header-attrs-2.10/header-attrs.js delete mode 100644 docs/articles/TechnicalFAQ_files/header-attrs-2.11/header-attrs.js delete mode 100644 docs/articles/TechnicalFAQ_files/header-attrs-2.13/header-attrs.js delete mode 100644 docs/articles/TechnicalFAQ_files/header-attrs-2.9/header-attrs.js delete mode 100644 docs/articles/chartConfiguration.html delete mode 100644 docs/articles/chartConfiguration_files/header-attrs-2.10/header-attrs.js delete mode 100644 docs/articles/chartConfiguration_files/header-attrs-2.11/header-attrs.js delete mode 100644 docs/articles/chartConfiguration_files/header-attrs-2.13/header-attrs.js delete mode 100644 docs/articles/chartConfiguration_files/header-attrs-2.9/header-attrs.js delete mode 100644 docs/articles/customWorkflows.html delete mode 100644 docs/articles/index.html delete mode 100644 docs/articles/intro.html delete mode 100644 docs/articles/intro_files/header-attrs-2.10/header-attrs.js delete mode 100644 docs/articles/intro_files/header-attrs-2.11/header-attrs.js delete mode 100644 docs/articles/intro_files/header-attrs-2.13/header-attrs.js delete mode 100644 docs/articles/intro_files/header-attrs-2.9/header-attrs.js delete mode 100644 docs/articles/shinyUserGuide.html delete mode 100644 docs/authors.html delete mode 100644 docs/bootstrap-toc.css delete mode 100644 docs/bootstrap-toc.js delete mode 100644 docs/docsearch.css delete mode 100644 docs/docsearch.js delete mode 100644 docs/index.html delete mode 100644 docs/link.svg delete mode 100644 docs/news/index.html delete mode 100644 docs/pkgdown.css delete mode 100644 docs/pkgdown.js delete mode 100644 docs/pkgdown.yml delete mode 100644 docs/reference/Rplot001.png delete mode 100644 docs/reference/SafetyGraphics.html delete mode 100644 docs/reference/addChart.html delete mode 100644 docs/reference/addSetting.html delete mode 100644 docs/reference/adlbc.html delete mode 100644 docs/reference/app_startup.html delete mode 100644 docs/reference/chartRenderer-shiny.html delete mode 100644 docs/reference/chartRenderer.html delete mode 100644 docs/reference/chartsMetadata.html delete mode 100644 docs/reference/chartsNav.html delete mode 100644 docs/reference/chartsTab.html delete mode 100644 docs/reference/chartsTabUI.html delete mode 100644 docs/reference/checkColumn.html delete mode 100644 docs/reference/checkField.html delete mode 100644 docs/reference/checkNumeric.html delete mode 100644 docs/reference/checkRequired.html delete mode 100644 docs/reference/createChart.html delete mode 100644 docs/reference/detectStandard.html delete mode 100644 docs/reference/evaluateStandard.html delete mode 100644 docs/reference/filterTab.html delete mode 100644 docs/reference/filterTabChecks.html delete mode 100644 docs/reference/filterTabUI.html delete mode 100644 docs/reference/generateMappingList.html delete mode 100644 docs/reference/generateSettings.html delete mode 100644 docs/reference/generateShell.html delete mode 100644 docs/reference/getRequiredSettings.html delete mode 100644 docs/reference/getSettingKeys.html delete mode 100644 docs/reference/getSettingValue.html delete mode 100644 docs/reference/getSettingsMetadata.html delete mode 100644 docs/reference/hasColumn.html delete mode 100644 docs/reference/hasField.html delete mode 100644 docs/reference/homeTab.html delete mode 100644 docs/reference/homeTabUI.html delete mode 100644 docs/reference/index.html delete mode 100644 docs/reference/loadCharts.html delete mode 100644 docs/reference/loadChartsUI.html delete mode 100644 docs/reference/loadData.html delete mode 100644 docs/reference/loadDataUI.html delete mode 100644 docs/reference/makeChartConfig.html delete mode 100644 docs/reference/makeChartExport.html delete mode 100644 docs/reference/makeChartParams.html delete mode 100644 docs/reference/makeChartSummary.html delete mode 100644 docs/reference/makeMapping.html delete mode 100644 docs/reference/makeMeta.html delete mode 100644 docs/reference/mappingColumn.html delete mode 100644 docs/reference/mappingColumnUI.html delete mode 100644 docs/reference/mappingDomain.html delete mode 100644 docs/reference/mappingDomainUI.html delete mode 100644 docs/reference/mappingSelect.html delete mode 100644 docs/reference/mappingSelectUI.html delete mode 100644 docs/reference/mappingTab.html delete mode 100644 docs/reference/mappingTabUI.html delete mode 100644 docs/reference/meta.html delete mode 100644 docs/reference/pipe.html delete mode 100644 docs/reference/prepareChart.html delete mode 100644 docs/reference/removeCharts.html delete mode 100644 docs/reference/removeSettings.html delete mode 100644 docs/reference/safetyGraphicsApp.html delete mode 100644 docs/reference/safetyGraphicsInit.html delete mode 100644 docs/reference/safetyGraphicsServer.html delete mode 100644 docs/reference/safetyGraphicsUI.html delete mode 100644 docs/reference/setMappingListValue.html delete mode 100644 docs/reference/setSettingsValue.html delete mode 100644 docs/reference/settingsCharts.html delete mode 100644 docs/reference/settingsChartsUI.html delete mode 100644 docs/reference/settingsCode.html delete mode 100644 docs/reference/settingsCodeUI.html delete mode 100644 docs/reference/settingsData.html delete mode 100644 docs/reference/settingsDataUI.html delete mode 100644 docs/reference/settingsMapping.html delete mode 100644 docs/reference/settingsMappingUI.html delete mode 100644 docs/reference/settingsMetadata.html delete mode 100644 docs/reference/settingsTab.html delete mode 100644 docs/reference/settingsTabUI.html delete mode 100644 docs/reference/standardsMetadata.html delete mode 100644 docs/reference/textKeysToList.html delete mode 100644 docs/reference/trimData.html delete mode 100644 docs/reference/trimSettings.html delete mode 100644 docs/reference/validateSettings.html delete mode 100644 docs/sitemap.xml rename vignettes/{chartConfiguration.Rmd => ChartConfiguration.Rmd} (100%) rename vignettes/{intro.Rmd => Intro.Rmd} (99%) diff --git a/_pkgdown.yml b/_pkgdown.yml index e59b58b6..dd3b77d1 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -12,13 +12,13 @@ navbar: - text: Vignettes menu: - text: Intro to Shiny App - href: articles/intro.html + href: articles/Intro.html - text: Chart Configuration - href: articles/chartConfiguration.html + href: articles/ChartConfiguration.html - text: Examples Cookbook - href: articles/cookbook.html + href: articles/Cookbook.html - text: Technical FAQ - href: articles/technicalFAQ.html + href: articles/TechnicalFAQ.html - text: Functions href: reference/index.html - text: News diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index 8da3389f..00000000 --- a/docs/404.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - -Page not found (404) • safetyGraphics - - - - - - - - - - - -
    -
    - - - - -
    -
    - - -Content not found. Please use links in the navbar. - -
    - - - -
    - - - -
    - -
    -

    -

    Site built with pkgdown 2.0.2.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html deleted file mode 100644 index a621d578..00000000 --- a/docs/LICENSE-text.html +++ /dev/null @@ -1,104 +0,0 @@ - -License • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    YEAR: 2021
    -COPYRIGHT HOLDER: safetyGraphics authors
    -
    - -
    - - - -
    - - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/LICENSE.html b/docs/LICENSE.html deleted file mode 100644 index 4d36dbb6..00000000 --- a/docs/LICENSE.html +++ /dev/null @@ -1,108 +0,0 @@ - -MIT License • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    - -

    Copyright (c) 2021 safetyGraphics authors

    -

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    -

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    -

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    -
    - -
    - - - -
    - - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/articles/Cookbook.html b/docs/articles/Cookbook.html deleted file mode 100644 index ef26cda7..00000000 --- a/docs/articles/Cookbook.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - -Cookbook • safetyGraphics - - - - - - - - - - - - -
    -
    - - - - -
    -
    - - - - -
    -

    Cookbook Vignette -

    -

    This vignette contains a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios.

    -
    -
    -

    Overview -

    -

    Most of the customization shown here is done by changing 4 key parameters in the safetyGraphicsApp() function:

    -
      -
    • -domainData – Domain-level Study Data
    • -
    • -mapping – List identifying the key columns/fields in your data
    • -
    • -charts – Define the charts used in the app.
    • -
    • -meta – Metadata table with info about required columns and fields
    • -
    -

    domainData and mapping generally change for every study, while charts and meta can generally be re-used across many studies.

    -

    The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the Chart Configuration Vignette or our 2021 R/Pharma Workshop

    -
    -
    -

    Setup and installation -

    -

    safetyGraphics requires R v4 or higher. These examples have been tested using RStudio v1.4, but should work on other platforms with proper configuration.

    -

    You can install safetyGraphics from CRAN like any other R package:

    -
    install.packages("safetyGraphics")
    -library("safetyGraphics")
    -

    Or to use the most recent development version from GitHub, call:

    -
    devtools::install_github("safetyGraphics/safetyCharts", ref="dev")
    -library(safetyCharts)
    -devtools::install_github("safetyGraphics/safetyGraphics", ref="dev")
    -library(safetyGraphics)
    -safetyGraphics::safetyGraphicsApp()
    -
    -

    Example 1 - Default App -

    -

    To run the app with no customizations using sample AdAM data from the {safetyData} package, install the package and run:

    -
    safetyGraphics::safetyGraphicsApp()
    -
    -
    -
    -

    Loading Custom Data -

    -

    The next several examples focus on study-specific customizations for loading and mapping data.

    -
    -

    Example 2 - SDTM Data -

    -

    The data passed in to the safetyGraphics app can be customized using the domainData parameter in safetyGraphicsApp(). For example, to run the app with SDTM data saved in {safetyData}, call:

    -
    sdtm <- list(
    -    dm=safetyData::sdtm_dm,
    -    aes=safetyData::sdtm_ae,
    -    labs=safetyData::sdtm_lb
    -)
    -
    -safetyGraphics::safetyGraphicsApp(domainData=sdtm)
    -
    -
    -

    Example 3 - Single Data Domain -

    -

    Running the app for a single data domain, is similar:

    -
    justLabs <- list(labs=safetyData::adam_adlbc)
    -safetyGraphics::safetyGraphicsApp(domainData=justLabs)
    -

    Note that charts with missing data are automatically dropped and the filtering tab is not present since it requires demographics data by default.

    -
    -
    -

    Example 4 - Loading other data formats -

    -

    Users can also import data from a wide-variety of data formats using standard R workflows and then initialize the app. The example below initializes the app using lab data saved as a sas transport file (.xpt)

    -
    xptLabs <- haven::read_xpt('https://github.com/phuse-org/phuse-scripts/blob/master/data/adam/cdiscpilot01/adlbc.xpt?raw=true')
    -safetyGraphics::safetyGraphicsApp(domainData=list(labs=xptLabs))
    -
    -
    -

    Example 5 - Non-standard data -

    -

    Next, let’s initialize the the app with non-standard data. {safetyGraphics} automatically detects AdAM and SDTM data when possible, but for non-standard data, the user must provide a data mapping. This can be done in the app using the data/mapping tab, or can be done when the app is initialized by passing a mapping list to safetyGraphicsApp(). For example:

    -
    notAdAM <- list(labs=safetyData::adam_adlbc %>% rename(id = USUBJID))
    -idMapping<- list(labs=list(id_col="id"))
    -safetyGraphicsApp(domainData=notAdAM, mapping=idMapping)
    -
    -
    -

    Example 6 - Non-standard data #2 -

    -

    For a more realistic example, consider this labs data set (csv). The data can be loaded in to safetyGraphics with the code below, but several items in the mapping page need to be filled in:

    -
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    -safetyGraphics::safetyGraphicsApp(domainData=list(labs=labs))
    -

    drawing

    -

    Fortunately there is no need to re-enter this mapping information in every time you re-start the app. After filling in these values once, you can export code to restart the app with the specified settings pre-populated. First, click on the setting icon in the header and then on “code” to see this page:

    -

    -

    The YAML code provided here captures the updates you’ve made on the mapping page. To re-start the app with those settings, just save these YAML code in a new file called customSettings.yaml in your working directory, and then call:

    -
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    -customMapping <- read_yaml("customSettings.yaml")
    -safetyGraphics::safetyGraphicsApp(
    -    domainData=list(labs=labs),
    -    mapping=customMapping   
    -)
    -

    Note, that for more complex customizations, the setting page also provides a .zip file with a fully re-usable version of the app.

    -
    -
    -
    -

    Custom Charts -

    -

    The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this vignette.

    -
    -

    Example 7 - Drop Unwanted Charts -

    -

    Users can also generate a list of charts and then drop charts that they don’t want to include. For example, if you wanted to drop charts with type of “htmlwidgets” you could run this code.

    -
    library(purrr)
    -charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    -notWidgets <- charts %>% purrr::keep(~.x$type != "htmlwidget")
    -safetyGraphicsApp(charts=notWidgets)
    -
    -
    -

    Example 8 - Edit Default Charts -

    -

    Users can also make modifications to the default charts by editing the list of charts directly.

    -
    charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    -charts$aeTimelines$label <- "An AMAZING timeline"
    -safetyGraphicsApp(charts=charts)
    -
    -
    -

    Example 9 - Add Hello World Custom Chart -

    -

    This example creates a simple “hello world” chart that is not linked to the data or mapping loaded in the app.

    -
    helloWorld <- function(data, settings){
    -    plot(-1:1, -1:1)
    -    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    -}
    -
    -# Chart Configuration
    -helloworld_chart<-list(
    -    env="safetyGraphics",
    -    name="HelloWorld",
    -    label="Hello World!",
    -    type="plot",
    -    domain="aes",
    -    workflow=list(
    -        main="helloWorld"
    -    )
    -)
    -
    -safetyGraphicsApp(charts=list(helloworld_chart))
    -
    -
    -

    Example 10 - Add a custom chart using data and settings -

    -

    The code below adds a new simple chart showing participants’ age distribution by sex.

    -
    ageDist <- function(data, settings){
    -    p<-ggplot(data = data, aes(x=.data[[settings$age_col]])) +
    -        geom_histogram() + 
    -        facet_wrap(settings$sex_col)
    -    return(p)
    -}
    -
    -ageDist_chart<-list(
    -    env="safetyGraphics",
    -    name="ageDist",
    -    label="Age Distribution",
    -    type="plot",
    -    domain="dm",
    -    workflow=list(
    -        main="ageDist"
    -    )
    -)
    -charts <- makeChartConfig() 
    -charts$ageDist<-ageDist_chart
    -safetyGraphicsApp(charts=charts)
    -
    -
    -

    Example 11 - Create a Hello World Data Domain and Chart -

    -

    Here we extend example 9 to include the creating of a new data domain with custom metadata, which is bound to the chart object as chart$meta. See ?makeMeta for more detail about the creation of custom metadata.

    -
    helloMeta <- tribble(
    -    ~text_key, ~domain, ~label,       ~standard_hello, ~description,
    -    "x_col",   "hello", "x position", "x",             "x position for points in hello world chart",   
    -    "y_col",   "hello", "y position", "y",             "y position for points in hello world chart"   
    -) %>% mutate(
    -    col_key = text_key,
    -    type="column"
    -)
    -
    -helloData<-data.frame(x=runif(50, -1,1), y=runif(50, -1,1))
    -
    -helloWorld <- function(data, settings){
    -    plot(-1:1, -1:1)
    -    text(data[[settings$x_col]], data[[settings$y_col]], "Custom Hello Domain!")
    -}
    -
    -helloChart<-prepareChart(
    -    list(
    -        env="safetyGraphics",
    -        name="HelloWorld",
    -        label="Hello World!",
    -        type="plot",
    -        domain="hello",
    -        workflow=list(
    -            main="helloWorld"
    -        ), 
    -        meta=helloMeta
    -    )
    -)
    -
    -charts <- makeChartConfig()
    -charts$hello <- helloChart #Easy to combine default and custom charts
    -data<-list(
    -    labs=safetyData::adam_adlbc, 
    -    aes=safetyData::adam_adae, 
    -    dm=safetyData::adam_adsl,
    -    hello=helloData
    -)
    -
    -#no need to specify meta since safetyGraphics::makeMeta() will generate the correct list by default. 
    -safetyGraphicsApp(
    -    domainData=data, 
    -    charts=charts
    -)
    -
    -
    -

    Example 13 - Create an ECG Data Domain & Chart -

    -

    This example defines a custom ECG data domain and adapts an existing chart for usage there. See this PR for a full implementation of the ECG domain in safetyCharts.

    -
    adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
    -
    -ecg_meta <-tibble::tribble(
    -    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    -    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    -    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    -    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    -"studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    -    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    -    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    -    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    -    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    -) %>% mutate(
    -    col_key = text_key,
    -    type="column"
    -)
    -
    -qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    -qtOutliers$label <- "QT Outlier explorer"
    -qtOutliers$domain <- "custom_ecg"
    -qtOutliers$meta <- ecg_meta
    -
    -safetyGraphicsApp(
    -    meta=ecg_meta, 
    -    domainData=list(custom_ecg=adeg), 
    -    charts=list(qtOutliers)
    -)
    -
    -
    -
    - - - -
    - - - -
    - -
    -

    -

    Site built with pkgdown 2.0.2.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/articles/Cookbook_files/header-attrs-2.10/header-attrs.js b/docs/articles/Cookbook_files/header-attrs-2.10/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/Cookbook_files/header-attrs-2.10/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/Cookbook_files/header-attrs-2.11/header-attrs.js b/docs/articles/Cookbook_files/header-attrs-2.11/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/Cookbook_files/header-attrs-2.11/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/Cookbook_files/header-attrs-2.13/header-attrs.js b/docs/articles/Cookbook_files/header-attrs-2.13/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/Cookbook_files/header-attrs-2.13/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/Cookbook_files/header-attrs-2.9/header-attrs.js b/docs/articles/Cookbook_files/header-attrs-2.9/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/Cookbook_files/header-attrs-2.9/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TechnicalFAQ.html b/docs/articles/TechnicalFAQ.html deleted file mode 100644 index 6fa45122..00000000 --- a/docs/articles/TechnicalFAQ.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - - - -Technical FAQ • safetyGraphics - - - - - - - - - - - - -
    -
    - - - - -
    -
    - - - - -
    -

    Technical FAQ Vignette -

    -

    This vignette answers frequently asked technical questions about {safetyGraphics}. It addressees questions on a variety of technical topics including Qualification and Validation status, Common Data Pipelines and Security.

    -

    Whenever new questions come in, we’ll update the version of this FAQ in our wiki - so check there first if you have a question. We’ll update the vignette on CRAN whenever a new version of the package is released.

    -
    -
    -

    Contributing -

    -
    -

    Q: Can I contribute code to the project? -

    -

    A: Yes. Check out our contributor guidelines. Feel free to follow-up with questions on the discussion board.

    -
    -
    -

    Q: Can I join the working group? -

    -

    A: Yes. Fill out this Google Form and we’ll get in touch.

    -
    -
    -
    -

    Validation, Quality Control and Testing -

    -
    -

    Q: Is the safetyGraphics package validated? -

    -

    A: As of the version 2 release, the safetyGraphics package is intended for exploratory use only and is not validated or qualified per 21 CFR Part 11. No warranty or guarantees are included as part of the package. Further, any formal validation should be fit for purpose and follow your organization’s procedures. That said, extensive quality checks are built in to the package (see the question below for details) and into many of charts that are included by default. The R Consortium has guidance on usage of R in Regulated Trials and we also follow the work of R Validation hub closely, and may release validation guidance based on the approach described in their white paper at a future date.

    -
    -
    -

    Q: Can I validate charts created by safetyGraphics? -

    -

    A: Study-specific instances of most safetyGraphics charts can be exported either as an R script or as a standalone html report. It may be possible to treat those outputs as standard TLFs (Tables, Listings and Figures) and conduct QC/Validation on them using standard statistical SOPs. Consult with your companies procedures to confirm.

    -
    -
    -

    Q: What testing/QC process for safetyGraphics? -

    -

    A: Several layers of quality control are included in our standard development workflow including: - Over 200 automated unit tests with testthat that run automatically via Continuous integration with GitHub actions. - Automated unit tests for shiny modules run via a headless browser using shinytest. - Pass all standard R checks in R cmd check - Full code review of all new functionality documented in GitHub PR. - Issue tracking in GitHub - Formal Alpha/Beta user testing before major releases - Basic user tests conducted before minor release

    -
    -
    -

    Q: Is the safetyGraphics app ready for “production” use? -

    -

    A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a variety of use cases. The details of a ‘production’ implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians.

    -

    That said, the issues surrounding a ‘production’ deployment are mostly technical and operational at this point and could likely be overcome by a motivated organization with ample technical expertise. Some of the issues that would need to be addressed in a production deployment:

    -
      -
    • Qualification documentation (Organization-specific)
    • -
    • Formalized deployment pipeline for Shiny with proper authentication and security (Organization-specific)
    • -
    • App Maintenance model (Organization-specific)
    • -
    • Data pipeline for study set-up and customization (Organization-specific)
    • -
    • Issues with big data set performance in htmlwidget renderers
    • -
    -

    Many of these issues aren’t specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. As discussed above, there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible.

    -

    Finally, it is worth noting “Productionize” and “Validate” are slightly different. Joe Cheng (the primary author of Shiny) has a nice talk on this topic from a software engineering perspective.

    -
    -
    -
    -

    Use Cases, Data Sources and Deployment -

    -
    -

    Q: I can see that the software has the MIT license, so does this essentially mean that any company would be free to use the software without restriction? -

    -

    A: Yes. The package is open source and free to use. Here’s a link to the license and a quick summary of how it works.

    -
    -
    -

    Q: What are some common use cases for safetyGraphics? -

    -

    A: safetyGraphics graphics has been used in a variety of ways. Some of the most common use cases thus far are: - Analysts exploring safety data - Clinicians monitoring ongoing studies - Analysts and Clinicians evaluating safety signals in completed studies

    -

    As an open source tool with a flexible data pipeline, many other use cases have been discussed: - Data review by Data Safety Monitoring Boards (link) - Visualizing Analysis results data (link) - Risk based monitoring

    -
    -
    -

    Q: Do I have to use a certain data standard with safetyGraphics? -

    -

    A: No. Any standard (or non-standard) data can be loaded as long as it meets the minimum data requirements for the selected data domain. Metadata capturing default CDISC standards are included with the app (see ?safetyGraphics::meta) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the cookbook vignette for examples.

    -
    -
    -

    Q: What data sources does safetyGraphics support? How do I load custom data? -

    -

    A: This topic is covered in detail in the Loading data section of the Introductory vignette. safetyGraphics is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the dataDomains parameter in the safetyGraphicsApp() function or via the safetyGraphicsInit() graphical user interface.

    -

    safetyGraphicsApp() - custom data can be loaded via the dataDomains parameter, which should be a list containing dataframes or tibbles for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or any number of other sources. See the cookbook vignette for some basic examples of loading custom data.

    -

    safetyGraphicsInit() - allows users to load tabular data from a variety of sources using the point-and-click interface provided in the {datamods} package.

    -

    More detail is provided in the Loading data section of the Introductory vignette

    -
    -
    -

    Is data loaded in to the safetyGraphics app secure? -

    -

    Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package.

    -

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5) - that could help to facilitate these discussion.

    -
    -
    -

    Q: How can the safetyGraphics app be shared? -

    -

    A: The safetyGraphics app can be shared using standard shiny methodology. More details for specific use cases are given in the next few questions. Charts created by safetyGraphics can also be exported and re-used. Charts created with htmlwidgets are especially flexible and can be used in many contexts - including in web applications outside of R.

    -
    -
    -

    Q: Do you recommend deploying the app to a dedicated server for internal usage? -

    -

    A: It depends a bit on your use-case and how the app is hosted. For example, analysts using the data in an exploratory fashion can probably just run it from RStudio, but if multiple medical monitors using the app for medical monitoring in active studies probably need a more robust (and possibly validated) set up using Shiny Server, RStudio Connect or something similar.

    -
    -
    -

    Q: Can I deploy safetyGraphics to shinyapps.io to explore trial data from my organization? -

    -

    A: We advise against loading non-authorized, private, or non-deidentified patient data outside of your organization’s firewall. Consult with your IT and QA first. There is huge risk associated with confidentiality, IP, and patient privacy. Also refer to ShinyApps.io Chapter 8 Security and Compliance.

    -
    -
    -

    -Q: Can I deploy safetyGraphics to an internal RStudio Connect server? -

    -

    A: Yes. The script below should be easy to deploy via the RStudio interface or by running rsconnect::deployApp() and can easily be customized to support custom data and charts.

    -
    # Launch the ShinyApp (Do not remove this comment)
    -library(safetyGraphics) 
    -safetyGraphics::safetyGraphicsApp(runNow = FALSE)
    -
    -
    -
    -

    Misc. -

    -
    -

    Q: How do I avoid R not choking on the huge volume of lab data? (from @AlbrechtDurer) -

    -

    A: Several of the JavaScript charts build using htmlwidgets do have performance issues with very large data sets. Focusing on specific toxicities helps, but probably isn’t enough for really big studies. In those cases, I think the most important thing is to design a your data pipeline to include both a database backend (as opposed to loading all of your study data each time you initialize the app) and visualizations that summarize the data in a reasonable way (as opposed to just plotting every single data point in a scatter plot no matter what). Fortunately this is all doable in R, and improvements in this area are on our road map for future releases of safetyGraphics.

    -
    -
    -
    - - - -
    - - - -
    - -
    -

    -

    Site built with pkgdown 2.0.2.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/articles/TechnicalFAQ_files/header-attrs-2.10/header-attrs.js b/docs/articles/TechnicalFAQ_files/header-attrs-2.10/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TechnicalFAQ_files/header-attrs-2.10/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TechnicalFAQ_files/header-attrs-2.11/header-attrs.js b/docs/articles/TechnicalFAQ_files/header-attrs-2.11/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TechnicalFAQ_files/header-attrs-2.11/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TechnicalFAQ_files/header-attrs-2.13/header-attrs.js b/docs/articles/TechnicalFAQ_files/header-attrs-2.13/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TechnicalFAQ_files/header-attrs-2.13/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/TechnicalFAQ_files/header-attrs-2.9/header-attrs.js b/docs/articles/TechnicalFAQ_files/header-attrs-2.9/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/TechnicalFAQ_files/header-attrs-2.9/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/chartConfiguration.html b/docs/articles/chartConfiguration.html deleted file mode 100644 index d9143910..00000000 --- a/docs/articles/chartConfiguration.html +++ /dev/null @@ -1,521 +0,0 @@ - - - - - - - -Chart Configuration • safetyGraphics - - - - - - - - - - - - -
    -
    - - - - -
    -
    - - - - -
    -

    Chart Configuration Vignette -

    -

    The {safetyGraphics} shiny app can be used to display a wide variety of charts. This vignette provides details about the charting process including step-by-step instructions for adding new charts and technical specifications, but first we need to talk about a 2nd package …

    -
    -
    -

    Introducing {safetyCharts} -

    -

    While this is technically a vignette for {safetyGraphics}, the {safetyCharts} package is just as important here. The roles of the packages can be summarized in just a few words:

    -

    The {safetyGraphics} platform displays charts from {safetyCharts}.

    -

    This relationship is central to the technical framework for the safetyGraphics app. By itself, the safetyGraphics platform really doesn’t do much! In fact, none of the content on the Charts tab is actually found in the safetyGraphics package; it’s all imported from elsewhere! As you’ve probably guessed, the default charts live in the safetyCharts package. safetyCharts has over a dozen charts that are configured to work with {safetyGraphics}, but can also easily be used independently.

    -

    While {safetyGraphics} and {safetyCharts} are designed to work seamlessly together, users can also add charts from other packages. In fact, several charts in {safetyCharts} are just wrappers that load charts from other packages for use in {safetyGraphics}. The rest of this vignette provides a series of step-by-step examples detailing how this process works for different types of charts.

    -
    -
    -

    {safetyGraphics} Chart Components -

    -

    To add a chart to safetyGraphics, two components are required:

    -
      -
    1. A Configuration Object
    2. -
    3. A Chart Function
    4. -
    -

    The configuration file captures metadata about the chart for use in the app and is typically saved as a YAML file. Several example configuration files are provided in the examples below, and YAML Configuration files for {safetyCharts} are saved here.

    -

    The chart function typically takes a list of settings and a list of data as inputs and returns a chart object ready to be displayed in the app. Details of charting functions vary somewhat for different chart types, as explained in the examples below.

    -

    A full technical specification of this chart configuration framework is provided in Appendix 1.

    -
    -
    -

    Example 1 - Hello World -

    -

    Once you’ve created the configuration and chart functions, the chart can be added to the app via the charts parameter in safetyGraphicsApp(). Consider this simple “Hello World” example:

    -
    # Chart Function
    -helloWorld <- function(data, settings){
    -    plot(-1:1, -1:1)
    -    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    -}
    -
    -# Chart Configuration
    -helloworld_chart<-list(
    -    env="safetyGraphics",
    -    name="HelloWorld",
    -    label="Hello World!",
    -    type="plot",
    -    domain="aes",
    -    workflow=list(
    -        main="helloWorld"
    -    )
    -)
    -
    -safetyGraphicsApp(charts=list(helloworld_chart))
    -

    It’s also easy to add a custom chart to the default charts provided in {safetyCharts} using the makeChartConfig() function:

    -
    charts <- makeChartConfig(packages="safetyCharts") # or just makeChartConfig() since safetyCharts is included by default
    -charts$helloworld<-helloworld_chart
    -safetyGraphicsApp(charts=charts)
    -

    Here’s our Hello World the chart running in the app:

    -

    -
    -
    -

    Example 2 - Static Outlier Explorer -

    -

    Now let’s consider a more complex example that makes use of the data and settings provided in safetyGraphics. In this section, we use {ggplot2} to create a spaghetti plot for tracking outliers in lab data. First, consider the following code which creates a stand-alone plot for a single data set:

    -
    # Use sample clinical trial data sets from the {safetyData} package
    -library(safetyData) 
    -library(ggplot2)
    -library(dplyr)
    -
    -# Define data mapping using a format similar to a reactive safetyGraphics mapping 
    -settings <- list(
    -    id_col="USUBJID",
    -    value_col="LBSTRESN",
    -    measure_col="LBTEST",
    -    studyday_col="LBDY"
    -)
    -
    -# Define a plotting function that takes data and settings as inputs 
    -spaghettiPlot <- function( data, settings ){
    -    # define plot aes - note use of standard evaluation! 
    -    plot_aes <- aes(
    -        x=.data[[settings$studyday_col]], 
    -        y=.data[[settings$value_col]], 
    -        group=.data[[settings$id_col]]
    -    )
    -
    -    #create the plot
    -    p<-ggplot(data = data, plot_aes) +
    -        geom_path(alpha=0.15) + 
    -        facet_wrap(
    -            settings$measure_col,
    -            scales="free_y"
    -        )
    -    return(p)
    -}
    -
    -spaghettiPlot(
    -    safetyData::sdtm_lb %>% 
    -        filter(LBTEST %in% c("Albumin","Bilirubin","Calcium","Chloride")), 
    -    settings
    -)
    -

    Running the code above should create a plot with 4 panels:

    -

    -

    With minor modifications, this chart can be added to the {safetyGraphics} shiny app, which allows us to create the chart with any mappings/data combination loaded in the app. The spaghettiPlot() function above is already written to work with safetyGraphics, so we just need to create the chart configuration object. This time we’ll capture the configuration in a YAML file.

    -
    env: safetyGraphics
    -label: Spaghetti Plot
    -name: spaghettiPlot
    -type: plot
    -domain: 
    -    - labs
    -workflow:
    -    main: spaghettiPlot
    -links:
    -    safetyCharts: https://github.com/SafetyGraphics/safetycharts
    -

    With the charting function loaded in to our session and the configuration file saved in our working directory as spaghetti.yaml, we can add the chart to the app as follows:

    -
    library(yaml)
    -charts <- makeChartConfig()
    -charts$spaghetti<-prepareChart(read_yaml('spaghetti.yaml'))
    -safetyGraphicsApp(charts=charts)
    -

    Under the charts tab, you’ll see:

    -

    -

    If you look closely at the spaghettiPlot() code above, you’ll noticed some details that make the chart work in the app:

    -
      -
    • The chart function is written as a function taking data and settings as inputs. This is the expected parameterization for most charts in {safetyGraphics}.
    • -
    • The references to settings use parameters that are defined on the mapping tab. Behind the scenes, these are defined in the safetyGraphics::meta.
    • -
    • The spaghettiPlot function is referenced in the main item the YAML workflow. This tells the app which function to use to draw the chart.
    • -
    • We’re using the .data[[]] pronoun in the chart function to access columns in the data based on the current settings. See these references for a lot more detail about functional programming in the tidyverse: - -
    • -
    -

    This example is inspired by safetyCharts::safety_outlier_explorer - the charting function and yaml configuration file on are GitHub.

    -
    -
    -

    Example 3 - Shiny Module -

    -

    {safetyGraphics} also supports defining charts as Shiny Modules. Once you’re familiar with modules, they are relatively straightforward to use with safetyGraphics.

    -

    Let’s take a look at a simple module that extends the functionality of the static chart from the example above. Once again, this example is based upon safetyCharts, and you can see the code and config on GitHub.

    -

    The config object for a module differs from a static chart is that the workflow section of the YAML file must specify ui and server functions instead of a main charting function. This example defines a simple UI function that allows users to select which lab measurements should be included in the spaghetti plot from example 1:

    -
    safetyOutlierExplorer_ui <- function(id) {
    -    ns <- NS(id) 
    -    sidebar<-sidebarPanel(
    -        selectizeInput(
    -            ns("measures"), 
    -            "Select Measures", 
    -            multiple=TRUE, 
    -            choices=c("")
    -        )
    -    )
    -    main<-mainPanel(plotOutput(ns("outlierExplorer")))
    -    ui<-fluidPage(
    -        sidebarLayout(
    -            sidebar,
    -            main,
    -            position = c("right"),
    -            fluid=TRUE
    -        )
    -    )
    -    return(ui)
    -}
    -

    Next we define a server function that populates the control for selecting measurements and then draws the plot using safetyCharts::safety_outlier_explorer() charting function - which is based on the spaghetti() function! Note that the server function takes a single reactive params object containing the data (params$data) and settings (param$settings) as input.

    -
    safetyOutlierExplorer_server <- function(input, output, session, params) {
    -
    -    ns <- session$ns
    -    # Populate control with measures and select all by default
    -    observe({
    -        measure_col <- params()$settings$measure_col
    -        measures <- unique(params()$data[[measure_col]])
    -        updateSelectizeInput(
    -            session, 
    -            "measures",
    -            choices = measures,
    -            selected = measures
    -        )
    -    })
    -
    -    # customize selected measures based on input
    -    settingsR <- reactive({
    -        settings <- params()$settings
    -        settings$measure_values <- input$measures
    -        return(settings)
    -    })
    -
    -    #draw the chart
    -    output$outlierExplorer <- renderPlot({safety_outlier_explorer(params()$data, settingsR())})
    -}
    -

    Finally, the YAML configuration file looks like this - just the workflow and label changes from Example 1:

    -
    env: safetyGraphics
    -label: Outlier Explorer - Module
    -name: outlierExplorerMod
    -type: module
    -package: safetyCharts
    -domain: 
    -    - labs
    -workflow:
    -    ui: safetyOutlierExplorer_ui
    -    server: safetyOutlierExplorer_server
    -links:
    -    safetyCharts: https://github.com/SafetyGraphics/safetycharts
    -

    Initializing the app as usual by adding it to the chart list: charts$outlierMod<-prepareChart(read_yaml('outlierMod.yaml'))

    -

    Unselecting a few measures gives the following display:

    -
    -
    -

    Example 4 - htmlwidgets and init functions -

    -

    You can also add custom htmlwidgets to safetyGraphics. In fact, many of the default charts imported from safetyCharts are javascript libraries that are imported as htmlwidgets. Like shiny modules, htmlwidgets are relatively simple to use once you are familiar with the basics.

    -

    The biggest differences between widgets and other charts in safetyGraphics are:

    -
      -
    1. The widget must be contained in a package, which must be specified in the YAML file.
    2. -
    3. The widget expects a widget item giving the name of the widget in the YAML workflow.
    4. -
    5. By default, the data and settings for a widget are passed in a list (list(data=data, settings=settings)) to the x parameter in htmlwidget::createWidget.
    6. -
    -

    Items 1 and 2 above are simple enough, but #3 is likely to create problems unless the widget is designed specifically for usage with safetyGraphics. That is, if the widget isn’t expecting x$settings to be a list that it uses to configure the chart, it probably isn’t going to work as expected.

    -

    Fortunately, there’s a workaround built in to safetyGraphics in the form of init workflow functions. Init functions run before the chart is drawn, and can be used to create custom parameterizations. The init function should take data and settings as inputs and return params which should be a list which is then provided to the chart (see the appendix for more details). The init function for the the interactive AE Explorer is a good example. It starts by merging demographics and adverse event data and then proceeds to create a customized settings object to match the configuration requirements of the javascript chart renderer. This init function is then saved under workflow$init in the chart config object.

    -

    The rest of the chart configuration YAML is similar to the examples above, and the chart is once again by passing the chart config object to safetyGraphicsApp()

    -
    -
    -

    Example 5 - Adding a Chart in a New Data Domain -

    -

    All of our examples so far have been focused on creating charts in our 3 default data domains (labs, adverse events and demographics), but there is no requirement that limits charts to these three data types. The data domains in the app are determined by a meta data frame that defines the columns and fields used in safetyGraphics charts, and customizing meta allows us to create charts for any desired data domains.

    -

    Generally speaking there are 3 steps to add a chart in a new domain:

    -
      -
    1. Create Metadata for a new data domain.
    2. -
    3. Define a chart using the new domain - like the examples above
    4. -
    5. Load data for the new domain
    6. -
    -

    Consider the following example, that modifies a chart from the labs domain for use on ECG data:

    -
    adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
    -
    -ecg_meta <-tibble::tribble(
    -    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    -    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    -    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    -    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    -    "studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    -    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    -    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    -    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    -    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    -) %>% mutate(
    -    col_key = text_key,
    -    type="column"
    -)
    -
    -qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    -qtOutliers$label <- "QT Outlier explorer"
    -qtOutliers$domain <- "custom_ecg"
    -qtOutliers$meta <- ecg_meta
    -
    -safetyGraphicsApp(
    -    domainData=list(custom_ecg=adeg), 
    -    charts=list(qtOutliers)
    -)
    -

    As of safetyGraphics v2.1, metadata can be saved directly to the chart object using chart$meta as shown in the example above.
    -Alternatively, metadata can be saved as a data object in the chart$package namespace. Chart-specific metadata should be saved as meta_{chart$name} while domain-level metadata should be named meta_{chart$domain}. It’s fine to use a combination of these approaches as appropriate for your chart. See ?safetyGraphics::makeMeta for more detail.

    -
    -
    -

    Appendix #1 - Chart Framework Technical Specifications -

    -
    -

    Configuration Overview -

    -

    -

    The diagram above summarizes the various components of the safetyGraphics charting framework:

    -
      -
    • The safetyGraphicsApp() function allows users to specify which charts to include in the shiny app via the charts parameter, which expects a list of charts.
    • -
    • Each item in charts is itself defined as a list that provides configuration details for a single chart. These configuration lists have several required parameters, which are described in the technical specification below.
    • -
    • Configuration lists are typically saved as YAML files, but can be also be loaded directly as list objects as shown in the Hello World example above.
    • -
    • Needed functions are bound to the chart object via the prepareChart() function. See the documentation for chart$functions below for full details.
    • -
    -
    -
    -

    Chart Specification -

    -

    Each item in the charts list should be a list() with the following parameters:

    -
      -
    • -env: Environment for the chart. Must be set to “safetyGraphics” or the chart is dropped. Type: character. Required -
    • -
    • -name: Name of the chart. Type: character. Required -
    • -
    • -type:: Type of chart. Valid options are: “plot”,“htmlwidget”,“html”,“table” and “module”. Type: character. Required -
    • -
    • -label: A short description of the chart. chart$name is used if not provided. Type: character. Optional -
    • -
    • -domain: The data domain(s) used in the chart. Type: character. Required -
    • -
    • -package: The package where the {htmlwidget} is saved. Type: character. Required when chart$type is “htmlwidget”
    • -
    • -meta: Table of chart-specific metadata. Metadata can also be saved as {package}::meta_{chart} or {package::meta_{domain}. See ?safetyGraphics::makeMeta for more detail.
    • -
    • -order: Order in which to display the chart. If order is a negative number, the chart is dropped. Defaults to 999999. Type: Integer. Optional -
    • -
    • -links: Named list of link names/urls to be shown in the chart header. Type: list of character. Optional -
    • -
    • -path: Full path of the YAML file. Auto-generated by makeChartConfig() Type: character optional -
    • -
    • -workflow: Names of functions used to create the chart. Should be loaded in global environment or included in chart$package before calling prepareChart(). Supported parameters are listed below. Type: list of character. Required -
        -
      • -workflow$main: name of the function to draw the chart. The function should take data and settings parameters unless the input parameters are customized by an init function. Required, unless chart$type is “htmlwidget” or “module”)
      • -
      • -workflow$init: name of initialization function that runs before chart is drawn via themainfunction. Should takedataandsettingsas input and return a list of parameters accepted by themain` function. Optional -
      • -
      • -workflow$widget: name or widget saved in chart$package to be passed to htmlwidgets::createWidget Required when chart$type is “htmlwidget”
      • -
      • -workflow$ui and workflow$server: names of functions to render shiny ui and server. Automatically generated in prepareChart() unless chart$type is “module”. Required when chart$type is ‘module’
      • -
      -
    • -
    • -functions: a list of functions used to create the chart. Typically generated at runtime by prepareChart() using information in chart$workflow, chart$type and chart$package. Not recommended to generate manually. Type: list of functions. Required -
    • -
    -
    -
    -

    Default Technical workflow -

    -

    This appendix describe the technical process used to render a chart when safetyGraphicsApp() is called with the default parameters.

    -
      -
    1. -safetyGraphicsApp() is called with charts and chartSettingsPath as NULL (the default).
    2. -
    3. -app_startup is called, which then immediately calls makeChartConfig().
    4. -
    5. -makeChartConfig() looks for charts in the safetyCharts package (the default) since no path was specified. The function looks for the package in all current .libPaths() and then looks in the inst/config folder once the package is found.
    6. -
    7. -makeChartConfig loads YAML configuration files in the specified directories and saves them to a list. name and path parameters are added.
    8. -
    9. -makeChartConfig calls prepareChart for each chart configuration. prepareChart sets default values for order, name and export, and then binds relevant functions to a chart$functions list based on the chart’s type, workflow and package.
    10. -
    11. That list of charts is then returned to app_startup() which runs a few actions on each chart: -
        -
      • If chart$functions is missing, prepareChart is called (not relevant in the default workflow, but useful for adding custom charts)
      • -
      • If chart$order is negative, the chart is dropped with a message.
      • -
      • If chart$env is not “safetyGraphics”, the chart is dropped with a message.
      • -
      • If chart$domains has elements not found in the dataDomains passed to `app_startup(), the chart is dropped with a message.
      • -
      • -charts are re-ordered based on chart$order -
      • -
      -
    12. -
    13. -app_startup passes the updated list of charts to makeMeta assuming no meta object was provided. makeMeta combines metadata from all charts in to a single data.frame. Charts can save metadata as chart.meta, {package}::meta_{chart} or {package}::meta_{domain}.
    14. -
    15. -app_startup returns the list of charts and associated metadata to safetyGraphicsApp which then then passes them along to safetyGraphicsServer as the charts parameter.
    16. -
    17. -safetyGraphicsServer then creates modules for each chart. First, UIs are created via chartsNav() which then calls: -
        -
      • -makeChartSummary to create the chart header with links and metadata and …
      • -
      • -ChartsTabUI which then calls chart$functions$ui to create the proper UI element based on chart$type.
      • -
      -
    18. -
    19. Next, safetyGraphicsServer draws the charts using chartsTab() which: -
        -
      • Creates a reactive params object containing mappings and data using makeChartParams() which: -
          -
        • Subsets domainData based on chart$domain -
        • -
        • Calls charts$functions$init if provided
        • -
        • Does custom formatting for chart$type of “htmlwidget”
        • -
        -
      • -
      • Chart is drawn using chart$functions$server and chart$functions$main -
      • -
      • Button to download R script is added to header. Script is created by makeChartExport() -
      • -
      • Button to download html report is added to header unless type=“module”. Report template is at “inst/reports/safetyGraphicsReport.Rmd”
      • -
      -
    20. -
    21. Finally, safetyGraphicsServer passes the charts to settingsTab, which uses them to help populate the charts and code subtabs.
    22. -
    -
    -
    -
    - - - -
    - - - -
    - -
    -

    -

    Site built with pkgdown 2.0.2.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/articles/chartConfiguration_files/header-attrs-2.10/header-attrs.js b/docs/articles/chartConfiguration_files/header-attrs-2.10/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/chartConfiguration_files/header-attrs-2.10/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/chartConfiguration_files/header-attrs-2.11/header-attrs.js b/docs/articles/chartConfiguration_files/header-attrs-2.11/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/chartConfiguration_files/header-attrs-2.11/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/chartConfiguration_files/header-attrs-2.13/header-attrs.js b/docs/articles/chartConfiguration_files/header-attrs-2.13/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/chartConfiguration_files/header-attrs-2.13/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/chartConfiguration_files/header-attrs-2.9/header-attrs.js b/docs/articles/chartConfiguration_files/header-attrs-2.9/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/chartConfiguration_files/header-attrs-2.9/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/customWorkflows.html b/docs/articles/customWorkflows.html deleted file mode 100644 index a71dc867..00000000 --- a/docs/articles/customWorkflows.html +++ /dev/null @@ -1,576 +0,0 @@ - - - - - - - -safetyGraphics Shiny App - Custom Workflows • safetyGraphics - - - - - - - - - - -
    -
    - - - - -
    -
    - - - - -
    -

    -Overview

    -

    The safetyGraphics package is designed to serve as a flexible and extensible platform for analyzing clinical trial safety. This vignette shows how users can configure the safetyGraphics shiny app with workflows using customized charts and data.

    -

    Version 1.1 of the package allows users to preload their own charts and data sets for use in the safetyGraphics Shiny Application. Many types of clinical trial lab data are supported in conjunction with 4 types of charts - Static charts, Plotly charts, Shiny Modules and HTML widgets. As shown in the next section, loading data is simple, but adding custom charts is slightly more complex. Behind the scenes, all 4 chart types have two major technical components: code and metadata. As such, making a custom chart requires the user to create an R script that defines the chart’s code and metadata. We provide several examples below that describe the step-by-step process for creating a chart.

    -
    -
    -

    -Adding Custom Data

    -

    Run safetyGraphicsApp(loadData=TRUE) to preload all data.frames from your current R session in a new instance of the safetyGraphics Shiny app. While users can still manually load additional .csv or .sas7bdat files in the app as needed, this programatic alternative allows for more flexibility for loading other data sources, and can help to automate situations where users want to load multiple files. For example, running the code below will preload several example data sets saved on our GitHub site.

    -
    #Load in data sets with different data standards
    -data_url <- 'https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/'
    -SDTM<-read.csv(paste0(data_url,'SampleData_SDTM.csv'))
    -SDTM_Partial<-read.csv(paste0(data_url,'SampleData_PartialSDTM.csv'))
    -AdAM_Partial<-read.csv(paste0(data_url,'SampleData_PartialADaM.csv'))
    -NoStandard<-read.csv (paste0(data_url,'SampleData_NoStandard.csv'))
    -AdAM <- adlbc #loadData=TRUE overrides the default behavior where adlbc is automatically preloaded into the app
    -
    -#Initialize the app with data from the session
    -safetyGraphicsApp(loadData=TRUE)
    -
    -

    Clicking on the data tab shows the 5 pre-loaded data sets with their different data standards.

    -

    -

    This data load process can easily be combined with the chart workflow described below (including customSettings.R programs) to create easily reusable, custom workflows.

    -
    -
    -

    -Steps to Create a Custom Chart

    -

    There are 4 steps required to create a custom chart for use in safetyGraphics:

    -
      -
    1. Create custom chart code
    2. -
    3. Add new settings to the app (if needed)
    4. -
    5. Add the chart to the app
    6. -
    7. Initialize the app
    8. -
    -

    The remainder of this vignette is dedicated to 4 examples that describe the process for creating custom charts in more detail. Note that full code for all examples are available in Appendix 3 at the end of this vignette.

    -
    -
    -

    -Example 1 - Hello World

    -

    To create a trivially simple custom chart, make a file called customSettings.R with the following code:

    -
    # Step 1 - Write custom chart code 
    -helloWorld <- function(data,settings){
    -  plot(-1:1, -1:1)
    -  text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    -}
    -
    -# Step 2 - Initialize Custom Settings 
    -# Not Applicable!
    -
    -# Step 3 - Initialize the custom chart 
    -addChart( 
    -  chart=”hello_world”,
    -  main=”helloWorld",
    -  label=”Hello World”, 
    -)
    -

    Then initialize the app (Step 4) by running:

    -
    setwd('/path/to/the/file/above')
    -safetyGraphicsApp()
    -

    Once the app opens, click the charts tab to view the new custom “hello_world” chart.

    -

    -
    -
    -

    -Example 2 - Detailed Walkthrough

    -

    Our second example goes through the chart creation process step-by-step for a more realistic example. An understanding of the underlying infrastructure for safetyGraphics will help here, so we recommend reviewing the first introductory vignette before diving in.

    -
    -

    -Step 1 - Create custom chart code

    -

    The first, and most complicated, step is to write the code for the custom chart. It’s easiest to break this process down in to 3 smaller steps.

    -
      -
    1. Create customSettings.R file
    2. -
    3. Make static code using sample data
    4. -
    5. Covert static chart code to Function
    6. -
    -
    -

    -Step 1.1 - Create customSettings.R file

    -

    First, create a file called customSettings.R and save it in a designated directory. All of the code in the following steps goes in this file. Note that when you run the app, custom medatadata files will be saved in the same directory as the customSettings.R file.

    -
    -
    -

    -Step 1.2 - Make Static Code Using Sample Data

    -

    Next, write code that creates your chart using a sample data set (the adlbc data set included with safetyGraphics is a good option). Note that all common charting packages are supported including ggplot2, lattice and base R graphics. Our example makes a histogram showing the distribution of lab values:

    -
    library(safetyGraphics)
    -library(ggplot2)
    -ggplot(
    -    data = adlbc, 
    -    aes(x = PARAM, y = AVAL)
    -) +
    - geom_boxplot(fill =‘blue’) +
    - scale_y_log10() +
    - theme_bw() +
    - theme(
    -  axis.text.x = element_text(angle = 25, hjust = 1),    
    -  axis.text = element_text(size = 12), 
    -  axis.title = element_text(size = 12)
    -)
    -

    As expected, running this code creates a simple box plot.

    -

    -
    -
    -

    -Step 1.3 - Convert Static Chart Code to a Function

    -

    After the chart is working using the sample data, you need to update it to a function that will work with any data set that the user loads in the shiny app. Replace hard coded parameters with references to the settings defined in the safetyGraphics settings object as shown below.

    -

    -

    This is the hardest part of creating a custom chart, so we’ve provided some additional notes about this process below. There is also a technical appendix at the end of this document that provides more details about the metadata/settings objects used in this step. Finally, feel free to ask ask us questions if you run in to problems.

    -
      -
    • The code to create the chart must be wrapped in a function that takes 2 parameters as inputs: data and settings as shown in line 1 above. When the chart function is called by Shiny, these parameters are generated dynamically within the app; data represents the user selection in the Data module, and settings represents the selections in the Settings Module.
    • -
    • The data parameter is saved as a data.frame, and a preview of the current data is conveniently available in the data tab.
      -
    • -
    • The settings parameter is saved as a list and is slightly more complex. Each setting shown on the settings page has a unique ID (called a text_key in the package) that gives its position in the settings list. In our example, the “Measure column” setting has the ID measure_col and is accessed in the charting function via settings$measure_col. Additional technical documentation about the settings list is provided in Appendix 1.
    • -
    • Lines 2-7 above create a new data frame called mapped_data. This isn’t required, but it simplifies the code somewhat and helps to avoid non-standard evaluation in the chart function.
    • -
    • Note that we dynamically identify the Value and Measure columns in lines 4 and 5 by referencing the settings object. This code, as opposed to directly specifying a column name like data$PARAM, allows the chart to work with any data standard.
    • -
    • Line 9 initializes the chart using ggplot() with the newly derived mapped_data.
    • -
    • Line 13 introduces a custom setting - settings[["boxcolor"]] - so that the user can specify a color for the bars in the shiny app if desired. All custom settings must be initialized using the addSetting() function; this process is described in Step 2 below.
    • -
    • Finally, note that the process for defining custom “htmlwidget” and “shiny module” charts is slightly different than the sample code above; example 3 provides basic example for a shiny module, and htmlwidgets are discussed in Appendix 2.
    • -
    -
    -
    -
    -

    -Step 2 - Add custom settings to the App

    -

    Next, we’ll add any new settings to the app by calling the addSetting() function in our customSettings.R function.

    -

    First, we need to determine which settings are already defined. As noted above, our chart uses 3 settings: value_col, measure_col and box_color. In most cases you can just examine the settingsMetadata data frame, which contains all settings available in safetyGraphics, along with details about each. Either view it with view(settingsMetadata) or use code like this:

    -

    -

    In some complex cases, it might be easier to examine an example settings object directly (rather than the data frame representation). To do this, you can create a shell settings object and then check to see if the settings exist:

    -

    -

    As shown in the output above, our example uses 2 pre-loaded settings (measure_col and value_col) and one new setting (boxcolor). We add boxcolor to the metadata using the addSetting() function as shown below.

    -
    addSetting( 
    -  text_key="boxcolor", 
    -  label="Box Plot Color", 
    -  description="The color of the boxes",
    -  setting_type="character",
    -  setting_cat="appearance", 
    -  default="gray"
    -) 
    -

    You could repeat as needed for multiple settings. For full details about each parameter see ?addSetting, which matches up with the column names in ?settingsMetadata.

    -
    -
    -

    -Step 3 - Add the chart to the App

    -

    Next, we need to add the chart itself to the app using addChart(). We’d add the example above as follows:

    -
    addChart( 
    -  chart="labdist", 
    -  main="labdist", 
    -  label="Lab Distribution - static", 
    -  requiredSettings=c("boxcolor","value_col","measure_col"),
    -  type="static”
    - )
    -

    For full details about each parameter see ?addChart, which matches up with the column names in ?chartMetadata.

    -
    -
    -

    -Step 4 - Initialize the app

    -

    Finally, make sure your working directory is set to the location of you customSettings.R and call safetyGraphicsApp(). The settings page for the new “Lab Distribution – Static” chart will look like this:

    -

    -

    And here is the chart:

    -

    -

    There are options that will let you save the custom code in other locations and/or automatically add a chart each time you run the app. See ?safetyGraphicsApp, ?addChart and ?addSettings for details.

    -
    -
    -
    -

    -Example 3 - Interactive Histogram

    -

    We can expand on our static boxplot from Example 2 by adding some interactivity. Placing our boxplot in a Shiny module will allow the user to make chart-specific aesthetic adjustments on the fly. In this example, we’ve added the ability to add/remove individual data points, transform the y-axis scale, and show/hide outliers:

    -

    -

    This example expands on the static boxplot example in the following ways: - Most of the underlying code for manipulating the dataset and creating the ggplot2 figure is identical to the static boxplot example. However, we’ve added some conditional statements to modify the boxplot based on the user selections. - Instead of a single chart function, we now have two: the module UI function, and the module server function. The UI function has the same name as the server function, with _UI appended. These functions should be specified (or sourced from an external file) within customSettings.R. - data and settings are passed to the module server function as reactive objects.

    -

    The full code for the custom script is saved in Appendix 3.

    -
    -
    -

    -Example 4 - Custom htmlwidget (Coming soon!)

    -

    Custom htmlwidgets are not currently supported via addChart() and addSetting()`, but we plan to add support in future release.

    -

    For now, please contact the package development team or file an issue on GitHub if you would like to add a custom htmlwidget to safetyGraphics, and we can discuss technical details.

    -
    -
    -

    -Appendix 1 - Technical Details

    -

    This appendix provides a detailed technical description of the settings framework used in the application. As described in the introductory vignette, the settings Shiny module allows users to make a wide range of customizations to the charts for any given study. Understanding the underlying technical details of this settings customization process is perhaps the most complicated aspect of designing custom charts for safetyGraphics. This appendix is broken in to 2 sections, the first describes the structure of the settings themselves, the second describes the metadata used to generate the settings when the package is built.

    -
    -

    -Settings Structure

    -

    Behind the scenes, the settings are stored as a list, which is updated in real time as the user makes changes in the Shiny settings module. A small chunk of a typical settings list is shown below. Note that this was generated using generateSettings(standard="adam"). More details on this and other functions related to settings is provided below.

    -

    -

    As described in the examples above, the current settings list is passed directly to the chart function whenever a user views a chart in the shiny app. Each control in the settings module is tied to a single component in the setting list using a unique key. That unique key defines the setting’s position in the list. You can see the unique key for any setting by hovering over the title for the control in the shiny app. As an example, the “ID column” control has a unique key of “id_col”, which is accessible in the settings list via settings$id_col, which would resolve to “USUBJID”, the default value for the ADaM data standard, in our sample settings above. The settings framework also supports nested settings. A double dash “–” indicates a level of nesting in the list, so a setting ID of “measure_values–ALT” would be accessed as settings[["measure_values"]][["ALT"]], which would resolve to “Alanine Aminotransferase (U/L)” in our sample settings.

    -

    You can see additional details about pre-loaded settings by viewing the safetyGraphics::settingsMetadata data file that contains the default settings for the shiny app. ?settingsMetadata provides detailed data specifications for the metadata file, which also match the options available in the addSetting() function used in the examples above.

    -

    The safetyGraphics package includes several functions specifically designed for use with settings objects. As mentioned above, you can generate a default settings list for a data standard using the generateSettings() function:

    -
    safetyGraphics::generateSettings()  # no standard
    -safetyGraphics::generateSettings(standard="ADaM") # ADaM standard
    -

    Other functions for working with settings (all used liberally by the shiny app) include: getRequiredSettings(), generateShell(), getSettingKeys(), getSettingValue(), getSettingsMetadata(), setSettingsValue(), trimSettings() and validateSettings(). The R documentation for each of these functions provides technical details and examples for common use cases. Note also that all of the charts included with the application have detailed standalone documentation referenced in the repo_url and settings_url fields found in the chartsMetadata file; for example, the hep-explorer’s configuration page is here and provides a lot of additional context about how each setting is used by the chart.

    -

    Finally, note that for htmlwidgets the settings list is converted to a json object with the following code:

    -
    settings_list <- list(...)
    -jsonlite::toJSON(
    -      settings_list,
    -      auto_unbox = TRUE,
    -      null = "null"
    -    )
    -
    -
    -

    -Metadata framework

    -

    In general, there are 3 primary types of metadata used in the shiny app: chart metadata, setting metadata and data standard metadata. The metadata files that provide key information to the Shiny app and allow for the app to automatically be updated with new charts, settings, and standards.

    -

    The underlying technical framework for the metadata is somewhat complex. In general, we follow the recommendations from the Data chapter in Hadley Wickham’s R Packages book. Using that workflow, we combine 5 “raw” metadata files (saved in data-raw\) in to 3 data files that are available as part of the package (saved in data\ with documentation in R\). An R script to convert the 5 “raw” files to the 3 files in the package is saved as data-raw\csv-to-rda.R, which is re-run whenever the metadata framework is updated.

    -

    The addChart() and addSetting() functions (and their evil twins removeCharts() and removeSettings()) allow users to customize these metadata files without actually rebuilding the entire package. These functions simply edit, add or remove rows from the settingsMetadata and chartsMetadata files saved in data\ and then save local copies of the files that are used in place of the default versions. This customization is likely enough for most users, but developers looking to make permanent changes to the apps default must go a level deeper and edit the files saved in data-raw/. More detail about those raw files is provided below, and step-by-step instructions for creating a new default chart are provided in Appendix 2.

    -
      -
    • Charts Metadata (chartsMetadata.csv): This file informs the Shiny app about all of the chart modules that should be made available to the user. The structure of this file is 1 row per chart. Columns contain chart-specific details such as chart name, type, and size.

    • -
    • Settings Metadata for Charts (settingsMetadataCharts.csv): This file helps the Shiny app understand which settings are needed for the different charts. This information is incorporated in the Settings configuration and Reporting modules. The structure of this file is 1 row per unique setting and 1 column per chart. TRUE/FALSE values are used to indicate whether the setting is relevant to a given chart.

    • -
    • Settings Metadata (settingsMetadata.csv): This file informs the Shiny app about all of the possible settings across all of the charts. Specifically, the file helps to populate the Settings tab of the app, and it also ensures that settings are successfully handed off to the charts. The structure is 1 row per setting and the columns contain information such as a description of the setting, type of setting (e.g. data mapping), and whether the setting is optional or required.

    • -
    • Settings Defaults (generateSettingsMetadataDefaults.R): Ths file contains information about the default values for the settings (specifically for non-data mapping settings). A .R file is used in place of a .csv to preserve the R value type (numeric, string, list, etc) of the defaults. While all settings are represented (structure of 1 row per setting), all data mapping defaults should be set to NULL and handled in the Standards metadata file.

    • -
    • Standards Metadata (standardsMetadata.csv): This file contains information about the default values for the settings for each data standard (specifically for data mapping settings). The file helps the Shiny app automatically detect data standards in uploaded files and automate settings configuration if the data is in a standard format. The structure of the file is 1 row per setting and 1 column per data standard. While all settings are represented, all rows corresponding to non-data mapping settings should be left blank.

    • -
    -
    -
    -
    -

    -Appendix 2 - Step-by-Step Process for Contributing a New Default Chart to safetyGraphics Package

    -
      -
    1. Make a new branch of the safetyGraphics master repository.

    2. -
    3. Create a new charting function using the guidelines in the examples above

    4. -
    5. Drop the file containing the charting function in the inst/custom directory, under the subfolder that matches the chart type (static, plotly, or Shiny module).

    6. -
    7. Update metadata
    8. -
    -
      -
    • Update metadata files: -
        -
      • For all custom charts: -
          -
        • Add a row for the new chart to data-raw/chartsMetadata.csv -
        • -
        • Add a column for the new chart to data-raw/settingsMetadataCharts.csv.
        • -
        -
      • -
      • For charts that contain new settings: -
          -
        • Add rows for new settings to data-raw/settingsMetadata.csv -
        • -
        • Add defaults for new settings in data-raw/generateSettingsMetadataDefaults.R and re-run the file.
        • -
        • Add rows for new settings in data-raw/settingsMetadataCharts.csv.
        • -
        • Add rows for new settings in the data standard mappings in data_raw/standardsMetaData.csv -
        • -
        -
      • -
      -
    • -
    • Run data-raw/csv_to_rda.R to save the files to data/.
    • -
    • Add chart to documentation file for settingsMetadata: R/settingsMetadata.R. Append chart_ to the name of your chart function/file and add it as an item in the list.
    • -
    -
      -
    1. Update package dependencies. If you’ve added a plotly chart:
    2. -
    -
      -
    • Add plotly to DESCRIPTION file Imports
    • -
    • Add library(plotly) to top of global.R file under inst/safetyGraphics_app -
    • -
    -
      -
    1. Update package documentation with devtools::document().

    2. -
    3. Rebuild the R package, test out the Shiny app, and make a PR to the safetyGraphics repo.

    4. -
    -
    -
    -

    -Appendix 3 - Full Custom Scripts for Examples

    -
    -

    -Full Code for Example 1 - Hello World

    -
    # Step 1 - Write custom chart code 
    -helloWorld <- function(data,settings){
    -  plot(-1:1, -1:1)
    -  text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    -}
    -
    -# Step 2 - Initialize Custom Settings 
    -# Not Applicable!
    -
    -# Step 3 - Initialize the custom chart 
    -addChart( 
    -  chart=”hello_world”,
    -  main=”helloWorld",
    -  label=”Hello World”, 
    -)
    -
    -
    -

    -Full Code for Example 2 - Static Histogram

    -
    custom_location<-"customBoxplot/"
    -
    -#####################################################################
    -# Step 1 - Write custom chart code
    -#####################################################################
    -labdist<-function(data,settings){
    -  mapped_data <- data %>%
    -    select(Value = settings[["value_col"]], Measure = settings[["measure_col"]])%>%
    -    filter(!is.na(Value))
    -  
    -  ggplot(data = mapped_data, aes(x = Measure, y = Value)) + 
    -    geom_boxplot(fill = settings[["boxcolor"]]) +
    -    scale_y_log10() +
    -    theme_bw() + 
    -    theme(axis.text.x = element_text(angle = 25, hjust = 1),
    -          axis.text = element_text(size = 12),
    -          axis.title = element_text(size = 12))
    -}
    -
    -#####################################################################
    -# Step 2 - Initialize Custom Settings
    -#####################################################################
    -addSetting(
    -  text_key="boxcolor", 
    -  label="Box Plot Color", 
    -  description="The color of the boxes", 
    -  setting_type="character", 
    -  setting_cat="appearance", 
    -  default="gray", 
    -  settingsLocation=custom_location
    -)
    -
    -
    -#####################################################################
    -# Step 3 - Initialize the custom chart
    -#####################################################################
    -addChart(
    -  chart="labdist",
    -  main="labdist", 
    -  label="Lab Distribution - static",
    -  settingsLocation = custom_location,
    -  requiredSettings=c("boxcolor","value_col","measure_col"),
    -  type="static"
    -)
    -
    -
    -

    -Full Code for Example 3 - Interactive Histogram

    -
    custom_location<-"customBoxplot/"
    -
    -#####################################################################
    -# Step 1 - Write custom chart module code
    -#####################################################################
    -labdist_module_UI <- function(id) {
    -  ns <- NS(id) 
    -  tagList(
    -    checkboxInput(ns("show_points"), "Show points?", value=FALSE),
    -    checkboxInput(ns("show_outliers"), "Show outliers?", value=TRUE),
    -    selectInput(ns("scale"), "Scale Transform", choices=c("Log-10","None")),
    -    plotOutput(ns("labdist"), width = "1000px")
    -  )
    -}
    -
    -labdist_module <- function(input, output, session, data, settings) {
    -  
    -  ns <- session$ns
    -  
    -  mapped_data <- reactive({
    -    data() %>%
    -      select(Value = settings()[["value_col"]],
    -             Measure = settings()[["measure_col"]])%>%
    -      filter(!is.na(Value)) 
    -  })
    -  
    -  output$labdist <- renderPlot({
    -    
    -    req(mapped_data())
    -    
    -    # set up the plot
    -    p <- ggplot(data = mapped_data(), aes(x = Measure, y = Value)) +
    -      theme_bw() +
    -      theme(axis.text.x = element_text(angle = 25, hjust = 1),
    -            axis.text=element_text(size=12),
    -            axis.title = element_text(size = 12))
    -    
    -    # add/remove outliers
    -    if (input$show_outliers){
    -      p <- p + geom_boxplot(fill = settings()[["boxcolor"]]) 
    -    } else {
    -      p <- p + geom_boxplot(fill = settings()[["boxcolor"]], outlier.shape = NA) 
    -    }
    -    
    -    # log-transform scale
    -    if (input$scale=="Log-10"){
    -      p <- p + scale_y_log10()
    -    }
    -    
    -    # show individual data points
    -    if (input$show_points){
    -      p <- p + geom_jitter(width = 0.2)
    -    }  
    - 
    -    p
    -  })
    -}
    -
    -#####################################################################
    -# Step 2 - Initialize Custom Settings
    -#####################################################################
    -addSetting(
    -  text_key="boxcolor", 
    -  label="Box Plot Color", 
    -  description="The color of the boxes", 
    -  setting_type="character", 
    -  setting_cat="appearance", 
    -  default="gray", 
    -  settingsLocation=custom_location
    -)
    -
    -#####################################################################
    -# Step 3 - Initialize the custom chart
    -#####################################################################
    -addChart(
    -  chart="labdist_module",
    -  main="labdist_module", 
    -  label="Lab Distribution - shiny module",
    -  settingsLocation = custom_location,
    -  requiredSettings=c("boxcolor","value_col","measure_col"),
    -  type="module"
    -)
    -
    -
    -
    - - - -
    - - - -
    - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - diff --git a/docs/articles/index.html b/docs/articles/index.html deleted file mode 100644 index 771d4a03..00000000 --- a/docs/articles/index.html +++ /dev/null @@ -1,107 +0,0 @@ - -Articles • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    All vignettes

    -

    - -
    Cookbook
    -
    -
    Technical FAQ
    -
    -
    Chart Configuration
    -
    -
    Intro to Shiny App
    -
    -
    -
    -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/articles/intro.html b/docs/articles/intro.html deleted file mode 100644 index fe33683f..00000000 --- a/docs/articles/intro.html +++ /dev/null @@ -1,278 +0,0 @@ - - - - - - - -Intro to Shiny App • safetyGraphics - - - - - - - - - - - - -
    -
    - - - - -
    -
    - - - - -
    -

    Intro Vignette -

    -

    The safetyGraphics shiny app provides an easy-to-use shiny interface for creating shareable safety graphics for any study. This vignette provides an overview of the app’s functionality, shows how to initialize the app with your own study data, and provides links to technical resources explaining how to customize the app.

    -
    -
    -

    safetyGraphics Demo -

    -

    A demo of shiny application using data from the {safetyData} package is hosted here. The app can also be initialized with the safetyGraphicsApp() function in the R console - see Appendix 1 for details.

    -

    Let’s take a quick look at the various pages in the app.

    -
    -

    Home Tab -

    -

    A home page has a basic overview of the app.

    -

    -
    -
    -

    Mapping Tab -

    -

    The Mapping tab is used to tell charts which data columns and fields to use for various chart components.

    -

    -

    This mapping process makes it easy to re-use charts across many different studies. You can see previews of the loaded data using the checkbox at the top of the page. The demo data has 3 data domains (labs, adverse events (aes) and demographics (dm)), but others can be added as well. The mapping tab is automatically filled in for common data standards, like the ADaM data shown here, but can also be filled in manually for non-standard data.

    -
    -
    -

    Filtering Tab -

    -

    The Filtering tab allows users to interactively select which participants to include in charts.

    -

    -

    This tab is created using the filter functionality included in the {datamods} package. Whenever data is filtered in this tab, those filtered data are used in all charts (across all data domains). Note that the number of participants selected is always shown in the upper right hand corner of the app.

    -
    -
    -

    Charts Tab -

    -

    Clicking the Charts tab opens a dropdown menu containing a series of charts related to clinical trial safety. Clicking the Hepatic Safety Explorer opens this page:

    -

    -

    safetyGraphics supports many different kinds of charts including web-based interactive graphics using {htmlwidgets} (like the chart shown above), static plots, plotly plots and custom shiny modules. Each chart has a header that provides details about the chart, links to chart-specific resources and buttons that allow users to download a stand-alone html report or a .R file that reproduces the chart. See the Chart Configuration Vignette for more detail about the safetyGraphics charting framework.

    -
    -
    -

    ⚙️ (Settings) Tab -

    -

    Finally, the Settings tab - shown as a gear icon ⚙️ - contains technical details that can be used to customize/troubleshoot the app. Clicking on the “Code” sub-tab (shown below) allows you to download a zip file that can be used to re-open the app with with any customizations that have been made during your current session.

    -

    -
    -
    -
    -

    Loading Study Data -

    -

    safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in appendix 2.

    -

    There are 2 primary ways to load your study data in to the safetyGraphics shiny app:

    -
      -
    1. Using safetyGraphicsInit() shiny interface
    2. -
    3. Passing data directly to safetyGraphicsApp() -
    4. -
    -
    -

    Loading data with safetyGraphicsInit() -

    -

    The safetyGraphicsInit() function starts a simple app that allows users to select charts and then load the data required via a point-and-click interface as shown below:

    -

    -

    The app dynamically determines which data sets are required for the selected charts and updates the “Data Loader” UI when the charts selection changes. Below, we’ve selected 2 charts from the labs domain - so the other data domains are automatically hidden.

    -

    -

    Once you’ve picked charts, click the “Load” buttons in the “Data Loader” section to select data files for each domain. Data is loaded using the import functionality from the {datamods} package which allows you to select data loaded in your R session or load data files directly from your file system. datamods supports any file format that {rio} can handle including text files, Excel, SAS and SPSS format.

    -

    Once you’ve loaded files for all of the active data domains, the “Run App” button will become active. Click it to initialize the app.

    -
    -
    -

    Passing data to safetyGraphicsApp() -

    -

    You can also initialize the app with custom data directly from the R console. The basic workflow is as follows:

    -
      -
    1. Load your data in to the R session
    2. -
    3. Save your data as a named list. The name of each list item should correspond to a safetyGraphics data domain.
    4. -
    5. Run safetyGraphicsApp() using the domainData to pass the list of data frames.
    6. -
    -

    Here is a simple example that starts the app with SDTM data from the safetyData library:

    -
    library(safetyData)
    -sdtm <- list(
    -    dm=safetyData::sdtm_dm,
    -    aes=safetyData::sdtm_ae,
    -    labs=safetyData::sdtm_lb
    -)
    -
    -safetyGraphics::safetyGraphicsApp(domainData=sdtm)
    -

    This example and other use cases are described in cookbook vignette.

    -
    -
    -

    Large Data sets -

    -

    Use the maxFileSize option to load data sets larger than 5 mb in safetyGraphicsInit (e.g. safetyGraphicsinit(maxFileSize=100)). safetyGraphicsApp() does not have size limits for data files, but note that large data (>100 mb) may cause performance issues.

    -
    -
    -
    -

    Additional Resources -

    -

    Several additional vignettes are available for more advanced topics:

    -
      -
    • -Chart Configuration Vignette - details about the charting process including technical specifications and step-by-step instructions
    • -
    • -Cookbook Vignette - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios
    • -
    • -Technical FAQ Vignette - vignette discussing security, validation and other technical issues
    • -
    -

    The {safetyGraphics} app is maintained by the Interactive Safety Graphics (ISG) subteam of the ASA Biopharm-DIA Safety Working Group. You can learn more about the team and find links to recent presentations and publications at our home page.

    -
    -
    -

    Appendix 1 - Initialization code -

    -

    We suggest running the app in RStudio with R version 4.0 or higher. The following code installs the {safetyGraphics} package and initializes the app demo:

    -
    install.packages('safetyGraphics')
    -library(safetyGraphics)
    -safetyGraphicsApp()
    -

    Or to use the initialization workflow:

    -
    install.packages('safetyGraphics')
    -library(safetyGraphics)
    -safetyGraphicsInit()
    -

    Or you can install the most recent development version of {safetyGraphics} and the companion package {safetyCharts} directly from GitHub:

    -
    install.packages("devtools")
    -library(devtools)
    -devtools::install_github("safetyGraphics/safetyGraphics") 
    -library(safetyGraphics)
    -devtools::install_github("safetyGraphics/safetyCharts") 
    -library(safetyCharts)
    -safetyGraphicsApp() #or safetyGraphicsInit()
    -
    -
    -

    Appendix 2 - Minimum Data Requirements -

    -

    Since the safetyGraphics framework supports adding custom charts (that may have custom settings), there are no universal data requirements for the app. However, the charts included by default version of the app are built to share requirements whenever possible. These requirements are captured in an included metadata file called safetyGraphics::meta.

    -

    The most basic requirements for the 3 default domains are:

    -
      -
    • -Lab results (labs) domain - Expects one record per person per visit per lab measurement with columns for: Participant ID, lab result, lab name, lower limit of normal, upper limit of normal, study day, study visit (numeric), study visit (character). See safetyGraphics::meta %>% filter(domain=="labs") for additional details and optional columns used by some charts.
    • -
    • -Adverse Event (aes) domain - Expects one record per adverse event with columns for: Participant ID, AE Sequence, Study Day, AE Start day, AE end day, AE preferred term and AE body system. See safetyGraphics::meta %>% filter(domain=="aes") -
    • -
    • -Demographics (dm) domain - Expects one record per person with columns for: Participant ID, Sex, Race, Age and Study Treatment (optional) . See safetyGraphics::meta %>% filter(domain=="dm") for additional details.
    • -
    -
    -
    - - - -
    - - - -
    - -
    -

    -

    Site built with pkgdown 2.0.2.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/articles/intro_files/header-attrs-2.10/header-attrs.js b/docs/articles/intro_files/header-attrs-2.10/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/intro_files/header-attrs-2.10/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/intro_files/header-attrs-2.11/header-attrs.js b/docs/articles/intro_files/header-attrs-2.11/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/intro_files/header-attrs-2.11/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/intro_files/header-attrs-2.13/header-attrs.js b/docs/articles/intro_files/header-attrs-2.13/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/intro_files/header-attrs-2.13/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/intro_files/header-attrs-2.9/header-attrs.js b/docs/articles/intro_files/header-attrs-2.9/header-attrs.js deleted file mode 100644 index dd57d92e..00000000 --- a/docs/articles/intro_files/header-attrs-2.9/header-attrs.js +++ /dev/null @@ -1,12 +0,0 @@ -// Pandoc 2.9 adds attributes on both header and div. We remove the former (to -// be compatible with the behavior of Pandoc < 2.8). -document.addEventListener('DOMContentLoaded', function(e) { - var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); - var i, h, a; - for (i = 0; i < hs.length; i++) { - h = hs[i]; - if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 - a = h.attributes; - while (a.length > 0) h.removeAttribute(a[0].name); - } -}); diff --git a/docs/articles/shinyUserGuide.html b/docs/articles/shinyUserGuide.html deleted file mode 100644 index e4042199..00000000 --- a/docs/articles/shinyUserGuide.html +++ /dev/null @@ -1,357 +0,0 @@ - - - - - - - -safetyGraphics Shiny App - User Guide • safetyGraphics - - - - - - - - - - -
    -
    - - - - -
    -
    - - - - -
    -

    -Overview

    -

    The safetyGraphics Shiny app provides an easy-to-use point-and-click interface to create shareable safety graphics for any study.

    -
    -
    -

    -Starting the Shiny App

    -

    After opening RStudio and making sure you are running R version 3.5 or higher, the application can be started with just a few lines of code. In general, you’ll want to load the latest stable release from CRAN:

    -
    install.packages("safetyGraphics")
    -library("safetyGraphics")
    -safetyGraphicsApp()
    -

    To load the latest development release from GitHub with devtools:

    -
    install.packages("devtools")
    -library("devtools")
    -devtools::install_github("SafetyGraphics/safetyGraphics")
    -library("safetyGraphics")
    -safetyGraphicsApp()
    -
    -

    -Loading Large Files

    -

    By default, Shiny only allows users to load files smaller than 5mb. If you want to load a larger file, use the maxFileSize setting when calling the app:

    -
    safetyGraphicsApp(maxFileSize = 100)
    -
    -
    -
    -

    -Typical Workflow

    -

    After opening the app, you will typically follow the workflow below. In short, you will load data (once), tweak settings and view charts (maybe more than once), and then export a snapshot of the charts for other users.

    -

    -

    This workflow lines up with the items in the toolbar for the App.

    -

    -

    More information about each step in the process is shown below.

    -
    -

    -Load Data

    -

    When you open the app, you are taken to the Home Tab which contains some general information about the app and links to helpful documentation. Click on the Data Tab and you should see the “Data Upload” and “Data Preview” panels. The preview for the pre-loaded “Example data” dataset is shown by default.

    -

    -

    To load your own data, simply click the browse button and select a .csv or .sas7bdat data set. Once the file is loaded, select it in the list at the bottom of the “Data Upload Panel”. Once selected, the “Data Preview” panel will update automatically (along with the Settings, Charts, and Reports tabs).

    -

    The charts in the safetyGraphics app are specifically designed for clinical trial safety monitoring, and require laboratory datasets that contain one row per participant per time point per measure. Data mappings for two common CDISC data standards - SDTM and ADaM - are pre-loaded in the application. As described below, the app can automatically generate charts for data sets using these standards; other data sets require some user configuration.

    -
    -
    -

    -Update Settings

    -

    After loading your data, navigate to the Settings tab to customize the behavior of the charts. This tab includes a Charts panel for selecting the charts you want to visualize and other panels for different types of chart settings. For example, the “Data Mappings” panel (shown below for the “Example Data” ADaM data set) can be used to specify the column that contains the unique subject ID, and on the more general “Appearance Settings” panel, there is an option to specify a warning message to be displayed when the chart loads. You can hover the mouse over any setting label to get more details. The small numbers to the right of the settings labels indicate the number of charts that use the relevant setting. Mousing over them presents a list of these charts.

    -

    -

    When possible, items on the settings tab are pre-populated based on the data standard of the selected data set. If a SAS data set with labels is provided, the relevant column labels will appear within brackets [] next to their variable names. You can see this in the Data Mappings screenshot above. See the Case Studies below for more details regarding working with non-standard data and adding customizations to the charts.

    -
    -
    -

    -View Chart

    -

    Once the settings configuration is complete, click on the Charts tab to view a drop-down of the available charts. A green check will display by charts that are ready to be visualized and a red X will indicate that settings need to be changed in order to render the chart. Simply click one of the options to view it. The chart tab updates automatically when settings are changed or new data is loaded. More details about chart functionality will be documented in separate vignettes.

    -

    -
    -
    -

    -Export Results

    -

    Navigate to the Reports tab to choose reports for export and click the “Export Chart(s)” button at the bottom to create a standalone copy of the charts using the current configuration. The export functionality combines the data, code, and settings for the charts in to a single file. In addition to the charts themselves, the export includes a summary of the tool, and code to recreate the customized charts in R.

    -

    -
    -
    -
    -

    -Case Study #1 - Mapping Non-Standard data

    -
    -

    -Overview

    -

    When a new data file is loaded, the app will detect whether the dataset is formatted according to ADaM or SDTM data standards. If the uploaded dataset matches one of these standards, the settings tab will be pre-populated accordingly, and little or no custom user customization will be needed to generate a basic chart. However, no data standard is strictly required; the app also works with data in other formats. The specific data columns required varies between charts. For example, the only firm data requirements for the Hepatic Explorer chart are:

    -
      -
    • The data must have one record per participant per timepoint per lab test. That is, the data should be long, not wide.
    • -
    • The data must have columns for: -
        -
      • Unique Subject Identifier (ID Column)
      • -
      • Name of Measure or Test (Measure Column)
      • -
      • Numeric finding or result (Value Column)
      • -
      • Numeric upper limit of normal for the test
      • -
      • Numeric lower limit of normal for the test
      • -
      • Numeric study day
      • -
      -
    • -
    • The following values must be present in the column corresponding to Measure or Test: -
        -
      • Aminotransferase, alanine (ALT)
      • -
      • Aminotransferase, aspartate (AST)
      • -
      • Alkaline phosphatase (ALP)
      • -
      • Total Bilirubin
      • -
      -
    • -
    -

    The app also supports data sets that partially match the pre-loaded data standards. The step-by-step instructions below outline how to create a chart for one such data set.

    -
    -
    -

    -Step-by-step

    - -
    -

    -2. Load Data

    -

    Use the “Browse..” button on the data upload section of the data tab to load a non-standard data set. We’ll use the .csv saved here, but the process is similar for other data sets. Notice that once the data is loaded, the app will detect whether the data matches one of those pre-loaded standards, and a note is added to indicate whether a match is found. Our sample data is a partial match for the SDTM standard. Once you select the newly loaded data set, the app should look like the screen capture below. Click on the Charts tab and note the red X’s in the drop-down indicating that user customization is needed.

    -

    -
    -
    -

    -3. Select Columns

    -

    Next, click the “Settings” tab in the nav bar at the top of the page. The page should look something like this:

    -

    -

    Behind the scenes, a validation process is run to check if the selected settings match up with the selected data set to create a valid chart. Green (for valid) and red (for invalid) status messages are shown after each label in the Settings tab - you can hover the mouse over the status to get more details.

    -

    As you can see, we’ve got several invalid settings with red status messages. We now need to go through and update each invalid setting and turn its status icon into a green check. Once all of the individual settings are valid, the red Xs in the Charts drop-down will turn to green checks, and the chart will be created. Let’s hover over the red X by the Measure Column Setting to see the detailed description of the failed check:

    -

    -

    As you might’ve guessed from the empty select box, the check failed because no value is specified for the setting. Choosing the measure column is simple. Click the select box to see pre-populated options corresponding to the columns in the data.

    -

    -

    Now select ID for the ID column, LBTEST for the Measure Column, and LBDY for the Study Day Column option. Your setting page should look something like this:

    -

    -

    Now we need to fill in the 4 inputs beneath Measure Column. You may have noticed that there were no options available for these inputs when the page loaded. This is because these options are field level data that depend on the Measure Column option. Once you selected a Measure Column, the options for these inputs were populated using the unique values found in that data column. To fill them in, just type the first few letters of the lab measure in the text box. For example, type “Alan” for the Alanine Aminotransferase value input and select the correct option.

    -

    -

    Repeat the process for the other 3 “value” inputs and viola, the red X changes to a green check, and the Hepatic Explorer chart is ready.

    -

    -
    -
    -

    -4. View Chart

    -

    Now that we’ve got the data mapping complete, just select “Hepatic Explorer” from the Chart tab drop-down.

    -

    -

    The chart has lots of useful interactive features built in, but we’ll cover those in a separate vignette.

    -
    -
    -

    -5. Export Chart

    -

    To export the chart, click the Reports Tab, make sure that the Hepatic Explorer has a check by it, and click the “Export Chart(s)” button. Your chart, along with the other valid charts, will be saved in an .html file and downloaded to your machine.

    -

    Open the downloaded file in a new tab in your browser and you’ll see tabs for each of the charts and an “Info” tab. The Hepatic Explorer tab will be identical to the chart shown above, with all of your customizations intact. The “Info” tab, shown below, has a brief description of the safetyGraphics package and source code that you can use to recreate the charts in R.

    -

    -

    The html file contains all of the data and code for the charts and is easy to share. Just send the file to the person you’re sharing with, and tell them to open it in their web browser (just double-click the file) - they don’t even need R.

    -
    -
    -
    -

    -Summary

    -

    This case study shows how to create a shareable chart created using custom settings in just a few clicks. Continue reading to find out how to add customizations to your chart.

    -
    -
    -
    -

    -Case Study #2 - Adding Customizations

    -
    -

    -Overview

    -

    Only the most basic settings used by the safetyGraphics displays are populated by default, but users can also add a wide variety of additional customization. We’ll walk through a few common customizations for the Hepatic Explorer chart in this case study including:

    -
      -
    • Adding grouping variables
    • -
    • Adding filter variables
    • -
    • Defining which rows should be included in the analyses using the Analysis Flag options
    • -
    • Defining the baseline measurement using the Baseline options
    • -
    -
    -
    -

    -Step-by-Step

    -
    -

    -1. Open the App

    -

    Just paste this code in to RStudio:

    -
    #Code to initialize shiny application
    -install.packages("safetyGraphics")
    -library("safetyGraphics")
    -safetyGraphicsApp()
    -

    We’ll use the pre-loaded example data for this case study, so there is no need to load your own data file.

    -
    -
    -

    -2. Add Filters and Groups

    -

    The SafetyGraphics Hepatic Explorer chart offers native support for data-driven groups and filtering. Any data column can be used to add filter and grouping controls to the chart. One common use case is to add grouping by treatment arm and filtering by site, race and sex. All of this can be done with just a few clicks. As you might have guessed, you just update the “Filter columns” and “Group columns” inputs as shown:

    -

    -

    Select “Hepatic Explorer” from the Charts drop-down tab to see the following chart (with orange boxes added around the newly created filters and groups for emphasis):

    -

    -

    A word of warning - both grouping and filtering work best using categorical variables with a relatively small number of groups (less than 10 or so). With that said, there is no official limit on the number of unique values to include in a group or filter, so if you followed the example above but chose “AGE” (with over a dozen unique integer values) instead of “AGEGR1” (with 3 categorical levels), you might not love the functionality in the chart. Fortunately, it’s easy to go back and update the chart to use the categorized variable instead - just go back to the settings tab and update the corresponding setting.

    -
    -
    -

    -3. Flag Rows of Special Interest

    -

    You can also use the settings page to identify important values in the data. For the Hepatic Explorer chart, you can flag baseline values (using the “Baseline column” and “Baseline values” inputs) and values included in the analysis population (using “Analysis Flag column” and “Analysis Flag values” inputs). In both cases, you need to choose the “column” first, and then choose 1 or more corresponding “values”. Here are some suggested settings using our sample data:

    -

    -

    In the Hepatic Explorer chart, adding a baseline flag enables the users to view a baseline-adjusted version of the chart. Click the chart tab, and then change the “Display Type” control to “Baseline Adjusted (mDish)”.

    -

    -

    We’re following ADaM conventions and using “flag” columns ending in “FL” and “Y” values for the configuration here, but any column/value combination is allowed. For example, you could use study day 0 to define baseline by setting baseline column to “ADY” and baseline value to “0”.

    -
    -
    -

    -Summary

    -

    This case study shows how to add some basic customizations to your Hepatic Explorer chart with a few clicks in the shiny application. Note that not all customizations are available in the shiny app. You can access more granular settings by looking at the documentation for the underlying hep-explorer github repo javascript library.

    -
    -
    -
    -
    - - - -
    - - - -
    - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index 073d5c67..00000000 --- a/docs/authors.html +++ /dev/null @@ -1,143 +0,0 @@ - -Authors and Citation • safetyGraphics - - -
    -
    - - - -
    -
    -
    - - - -
    • -

      Jeremy Wildfire. Maintainer, author. -

      -
    • -
    • -

      Becca Krouse. Author. -

      -
    • -
    • -

      Preston Burns. Author. -

      -
    • -
    • -

      Xiao Ni. Author. -

      -
    • -
    • -

      James Buchanan. Author. -

      -
    • -
    • -

      Susan Duke. Author. -

      -
    • -
    -
    -
    -

    Citation

    - Source: DESCRIPTION -
    -
    - - -

    Wildfire J, Krouse B, Burns P, Ni X, Buchanan J, Duke S (2022). -safetyGraphics: Interactive Graphics for Monitoring Clinical Trial Safety. -R package version 2.1.0, https://github.com/SafetyGraphics/safetyGraphics. -

    -
    @Manual{,
    -  title = {safetyGraphics: Interactive Graphics for Monitoring Clinical Trial Safety},
    -  author = {Jeremy Wildfire and Becca Krouse and Preston Burns and Xiao Ni and James Buchanan and Susan Duke},
    -  year = {2022},
    -  note = {R package version 2.1.0},
    -  url = {https://github.com/SafetyGraphics/safetyGraphics},
    -}
    - -
    - -
    - - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css deleted file mode 100644 index 5a859415..00000000 --- a/docs/bootstrap-toc.css +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ - -/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ - -/* All levels of nav */ -nav[data-toggle='toc'] .nav > li > a { - display: block; - padding: 4px 20px; - font-size: 13px; - font-weight: 500; - color: #767676; -} -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 19px; - color: #563d7c; - text-decoration: none; - background-color: transparent; - border-left: 1px solid #563d7c; -} -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 18px; - font-weight: bold; - color: #563d7c; - background-color: transparent; - border-left: 2px solid #563d7c; -} - -/* Nav: second level (shown on .active) */ -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} -nav[data-toggle='toc'] .nav .nav > li > a { - padding-top: 1px; - padding-bottom: 1px; - padding-left: 30px; - font-size: 12px; - font-weight: normal; -} -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 29px; -} -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 28px; - font-weight: 500; -} - -/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ -nav[data-toggle='toc'] .nav > .active > ul { - display: block; -} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js deleted file mode 100644 index 1cdd573b..00000000 --- a/docs/bootstrap-toc.js +++ /dev/null @@ -1,159 +0,0 @@ -/*! - * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) - * Copyright 2015 Aidan Feldman - * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ -(function() { - 'use strict'; - - window.Toc = { - helpers: { - // return all matching elements in the set, or their descendants - findOrFilter: function($el, selector) { - // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ - // http://stackoverflow.com/a/12731439/358804 - var $descendants = $el.find(selector); - return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); - }, - - generateUniqueIdBase: function(el) { - var text = $(el).text(); - var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); - return anchor || el.tagName.toLowerCase(); - }, - - generateUniqueId: function(el) { - var anchorBase = this.generateUniqueIdBase(el); - for (var i = 0; ; i++) { - var anchor = anchorBase; - if (i > 0) { - // add suffix - anchor += '-' + i; - } - // check if ID already exists - if (!document.getElementById(anchor)) { - return anchor; - } - } - }, - - generateAnchor: function(el) { - if (el.id) { - return el.id; - } else { - var anchor = this.generateUniqueId(el); - el.id = anchor; - return anchor; - } - }, - - createNavList: function() { - return $(''); - }, - - createChildNavList: function($parent) { - var $childList = this.createNavList(); - $parent.append($childList); - return $childList; - }, - - generateNavEl: function(anchor, text) { - var $a = $(''); - $a.attr('href', '#' + anchor); - $a.text(text); - var $li = $('
  • '); - $li.append($a); - return $li; - }, - - generateNavItem: function(headingEl) { - var anchor = this.generateAnchor(headingEl); - var $heading = $(headingEl); - var text = $heading.data('toc-text') || $heading.text(); - return this.generateNavEl(anchor, text); - }, - - // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). - getTopLevel: function($scope) { - for (var i = 1; i <= 6; i++) { - var $headings = this.findOrFilter($scope, 'h' + i); - if ($headings.length > 1) { - return i; - } - } - - return 1; - }, - - // returns the elements for the top level, and the next below it - getHeadings: function($scope, topLevel) { - var topSelector = 'h' + topLevel; - - var secondaryLevel = topLevel + 1; - var secondarySelector = 'h' + secondaryLevel; - - return this.findOrFilter($scope, topSelector + ',' + secondarySelector); - }, - - getNavLevel: function(el) { - return parseInt(el.tagName.charAt(1), 10); - }, - - populateNav: function($topContext, topLevel, $headings) { - var $context = $topContext; - var $prevNav; - - var helpers = this; - $headings.each(function(i, el) { - var $newNav = helpers.generateNavItem(el); - var navLevel = helpers.getNavLevel(el); - - // determine the proper $context - if (navLevel === topLevel) { - // use top level - $context = $topContext; - } else if ($prevNav && $context === $topContext) { - // create a new level of the tree and switch to it - $context = helpers.createChildNavList($prevNav); - } // else use the current $context - - $context.append($newNav); - - $prevNav = $newNav; - }); - }, - - parseOps: function(arg) { - var opts; - if (arg.jquery) { - opts = { - $nav: arg - }; - } else { - opts = arg; - } - opts.$scope = opts.$scope || $(document.body); - return opts; - } - }, - - // accepts a jQuery object, or an options object - init: function(opts) { - opts = this.helpers.parseOps(opts); - - // ensure that the data attribute is in place for styling - opts.$nav.attr('data-toggle', 'toc'); - - var $topContext = this.helpers.createChildNavList(opts.$nav); - var topLevel = this.helpers.getTopLevel(opts.$scope); - var $headings = this.helpers.getHeadings(opts.$scope, topLevel); - this.helpers.populateNav($topContext, topLevel, $headings); - } - }; - - $(function() { - $('nav[data-toggle="toc"]').each(function(i, el) { - var $nav = $(el); - Toc.init($nav); - }); - }); -})(); diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1d..00000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504cd..00000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 918f943f..00000000 --- a/docs/index.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - -Interactive Graphics for Monitoring Clinical Trial Safety • safetyGraphics - - - - - - - - - - - - -
    -
    - - - - -
    -
    - -

    R build status

    -
    - -

    The {safetyGraphics} package provides a framework for evaluating of clinical trial safety in R using a flexible data pipeline. The package includes a shiny application that allows users to explore safety data using a series of interactive graphics, including the hepatic safety explorer shown below. The package has been developed as part of the Interactive Safety Graphics (ISG) workstream of the ASA Biopharm-DIA Safety Working Group.

    -
    -

    edishgif

    -
    -
    -

    Using the app -

    -

    A demo of the app using sample data is available here or can be initialized as follows:

    -
    -install.packages("safetyGraphics")
    -library("safetyGraphics")
    -safetyGraphicsApp() #open the shiny application
    -

    The most common workflow is for a user to initialize the app with their data, adjust settings as needed, and view the interactive charts. Finally, the user can share any chart by exporting its source code or by generating a self-contained, fully reproducible report that can be shared with others.

    -

    Instructions for loading study data are provided in the introductory vignette and more complex customizations are provided in the cookbook vignette.

    -
    -
    -
    -

    Charts -

    -

    The app is built to support a wide variety of chart types including static plots (e.g. from {ggplot2}), shiny modules, {htmlwidgets} and even static outputs like RTFs. Several pre-configured charts are included in the companion {safetyCharts} R Package, and are available by default in the app. Other charts can be added using the process descibed in this vignette.

    -
    - -
    - - -
    - - -
    - -
    -

    -

    Site built with pkgdown 2.0.2.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/link.svg b/docs/link.svg deleted file mode 100644 index 88ad8276..00000000 --- a/docs/link.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/docs/news/index.html b/docs/news/index.html deleted file mode 100644 index d6b6daa8..00000000 --- a/docs/news/index.html +++ /dev/null @@ -1,130 +0,0 @@ - -Changelog • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    - -

    This release focuses on updates the safetyGraphics metadata framework:

    -
    • The default metadata table has been migrated to safetyCharts and modularized. In short,safetyGraphics::meta is now saved as safetyCharts::meta_aes, safetyCharts::meta_labs and safetyCharts::meta_dm.
    • -
    • A new makeMeta function has been created and integrated in to the default workflow for the Shiny app. makeMeta provides a much more flexible framework for creating and storing metadata. See ?makeMeta and the Cookbook and Chart Configuration vignettes for more details.
    • -
    -
    - -

    Version 2 of {safetyGraphics} is a major update that adds the following features:

    -
    • Added support for multiple data domains
    • -
    • Streamlined support for multiple chart types
    • -
    • Improved chart export and newly added full-app export
    • -
    • Single filtering module for all charts
    • -
    • New “Config” tab summarizing app configuration
    • -
    • Created new safetyGraphicsInit() app with a simple UI that can initialize the app with custom data/charts
    • -

    For more details, see the fully updated vignettes.

    -
    -
    - -

    Allows users to preload their own charts and data sets for use in the safetyGraphics Shiny Application. See the “Custom Workflows” Vignette for details and examples.

    -
    -
    - -

    The first production release of safetyGraphics includes many improvements including the addition of 5 new interactive graphics and an embedded help page with a detailed clinical workflow for using the tool.

    -
    -
    - -

    Initial CRAN release for safetyGraphics. The safetyGraphics package provides framework for evaluation of clinical trial safety. Users can interactively explore their data using the ‘Shiny’ application or create standalone ‘htmlwidget’ charts. Interactive charts are built using ‘d3.js’ and ‘webcharts.js’ ‘JavaScript’ libraries.

    -

    See the GitHub release tracker for additional release documentation and links to issues.

    -
    -
    - - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index 80ea5b83..00000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,384 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body { - position: relative; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -/* Ensure in-page images don't run outside their container */ -.contents img { - max-width: 100%; - height: auto; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -dd { - margin-left: 3em; -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - display: none; - margin-left: 5px; - width: 20px; - height: 20px; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -h1:hover .anchor, -h2:hover .anchor, -h3:hover .anchor, -h4:hover .anchor, -h5:hover .anchor, -h6:hover .anchor { - display: inline-block; -} - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Navbar submenu --------------------------*/ - -.dropdown-submenu { - position: relative; -} - -.dropdown-submenu>.dropdown-menu { - top: 0; - left: 100%; - margin-top: -6px; - margin-left: -1px; - border-radius: 0 6px 6px 6px; -} - -.dropdown-submenu:hover>.dropdown-menu { - display: block; -} - -.dropdown-submenu>a:after { - display: block; - content: " "; - float: right; - width: 0; - height: 0; - border-color: transparent; - border-style: solid; - border-width: 5px 0 5px 5px; - border-left-color: #cccccc; - margin-top: 5px; - margin-right: -10px; -} - -.dropdown-submenu:hover>a:after { - border-left-color: #ffffff; -} - -.dropdown-submenu.pull-left { - float: none; -} - -.dropdown-submenu.pull-left>.dropdown-menu { - left: -100%; - margin-left: 10px; - border-radius: 6px 0 6px 6px; -} - -/* Sidebar --------------------------*/ - -#pkgdown-sidebar { - margin-top: 30px; - position: -webkit-sticky; - position: sticky; - top: 70px; -} - -#pkgdown-sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#pkgdown-sidebar h2:first-child { - margin-top: 0; -} - -#pkgdown-sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -/* bootstrap-toc tweaks ------------------------------------------------------*/ - -/* All levels of nav */ - -nav[data-toggle='toc'] .nav > li > a { - padding: 4px 20px 4px 6px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; -} - -nav[data-toggle='toc'] .nav > li > a:hover, -nav[data-toggle='toc'] .nav > li > a:focus { - padding-left: 5px; - color: inherit; - border-left: 1px solid #878787; -} - -nav[data-toggle='toc'] .nav > .active > a, -nav[data-toggle='toc'] .nav > .active:hover > a, -nav[data-toggle='toc'] .nav > .active:focus > a { - padding-left: 5px; - font-size: 1.5rem; - font-weight: 400; - color: inherit; - border-left: 2px solid #878787; -} - -/* Nav: second level (shown on .active) */ - -nav[data-toggle='toc'] .nav .nav { - display: none; /* Hide by default, but at >768px, show it */ - padding-bottom: 10px; -} - -nav[data-toggle='toc'] .nav .nav > li > a { - padding-left: 16px; - font-size: 1.35rem; -} - -nav[data-toggle='toc'] .nav .nav > li > a:hover, -nav[data-toggle='toc'] .nav .nav > li > a:focus { - padding-left: 15px; -} - -nav[data-toggle='toc'] .nav .nav > .active > a, -nav[data-toggle='toc'] .nav .nav > .active:hover > a, -nav[data-toggle='toc'] .nav .nav > .active:focus > a { - padding-left: 15px; - font-weight: 500; - font-size: 1.35rem; -} - -/* orcid ------------------------------------------------------------------- */ - -.orcid { - font-size: 16px; - color: #A6CE39; - /* margins are required by official ORCID trademark and display guidelines */ - margin-left:4px; - margin-right:4px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top; min-width: 100px} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre, code, pre code { - background-color: #f8f8f8; - color: #333; -} -pre, pre code { - white-space: pre-wrap; - word-break: break-all; - overflow-wrap: break-word; -} - -pre { - border: 1px solid #eee; -} - -pre .img, pre .r-plt { - margin: 5px 0; -} - -pre .img img, pre .r-plt img { - background-color: #fff; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.error {font-weight: bolder;} -.warning {font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* headroom.js ------------------------ */ - -.headroom { - will-change: transform; - transition: transform 200ms linear; -} -.headroom--pinned { - transform: translateY(0%); -} -.headroom--unpinned { - transform: translateY(-100%); -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} - -/* fontawesome ------------------------ */ - -.fab { - font-family: "Font Awesome 5 Brands" !important; -} - -/* don't display links in code chunks when printing */ -/* source: https://stackoverflow.com/a/10781533 */ -@media print { - code a:link:after, code a:visited:after { - content: ""; - } -} - -/* Section anchors --------------------------------- - Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 -*/ - -div.csl-bib-body { } -div.csl-entry { - clear: both; -} -.hanging-indent div.csl-entry { - margin-left:2em; - text-indent:-2em; -} -div.csl-left-margin { - min-width:2em; - float:left; -} -div.csl-right-inline { - margin-left:2em; - padding-left:1em; -} -div.csl-indent { - margin-left: 2em; -} diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index 6f0eee40..00000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,108 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function($) { - $(function() { - - $('.navbar-fixed-top').headroom(); - - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); - } - - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } - - return(haystack.length); - } - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); - } - - if(ClipboardJS.isSupported()) { - $(document).ready(function() { - var copyButton = ""; - - $("div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); - - // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); - } - }); - - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); - } -})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index b78bf358..00000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,13 +0,0 @@ -pandoc: 2.11.4 -pkgdown: 2.0.2 -pkgdown_sha: ~ -articles: - Cookbook: Cookbook.html - TechnicalFAQ: TechnicalFAQ.html - chartConfiguration: chartConfiguration.html - intro: intro.html -last_built: 2022-04-02T14:46Z -urls: - reference: https://safetygraphics.github.io/safetyGraphics/reference - article: https://safetygraphics.github.io/safetyGraphics/articles - diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png deleted file mode 100644 index 17a358060aed2a86950757bbd25c6f92c08c458f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1011 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|=9Be?5+AI5}0x7m6Z+90U4Fo@(ch>_c&H|6f zVg?3oArNM~bhqvg0|WD9PZ!6KiaBo&GBN^{G%5UFpXcEKVvd5*5Eu=C0SJK)8A6*F U7`aXvEC5;V>FVdQ&MBb@00SN#Z2$lO diff --git a/docs/reference/SafetyGraphics.html b/docs/reference/SafetyGraphics.html deleted file mode 100644 index b0cddab8..00000000 --- a/docs/reference/SafetyGraphics.html +++ /dev/null @@ -1,111 +0,0 @@ - -safetyGraphics package — SafetyGraphics • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Create Interactive Graphics Related to Clinical Trial Safety

    -
    - - -
    -

    Details

    -

    Learn more on -CRAN -or GitHub

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/addChart.html b/docs/reference/addChart.html deleted file mode 100644 index 7622bb30..00000000 --- a/docs/reference/addChart.html +++ /dev/null @@ -1,225 +0,0 @@ - - - - - - - - -Adds a new chart for use in the safetyGraphics shiny app — addChart • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function updates settings objects to add a new chart to the safetyGraphics shiny app

    - -
    - -
    addChart(chart, label = "", description = "", repo_url = "",
    -  settings_url = "", main = "character", type = "static",
    -  maxWidth = 1000, requiredSettings = c(""),
    -  settingsLocation = getwd(), overwrite = TRUE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    chart

    Name of the chart - one word, all lower case

    label

    Nicely formatted name of the chart

    description

    Description of the chart

    repo_url

    Homepage for chart's code repository (if any)

    settings_url

    Homepage for chart's settings documentation

    main

    Name of the main function used to initialize the app. If the type is htmlwidgets, the js function must accept "location" and "settings" parameters (in that order) and have an .init() method, expecting a json data array. Otherwise, the r function should accept named data and settings parameters, and should be loaded in the user's namespace.

    type

    type of chart. Should be 'static', 'plotly' or 'module'

    maxWidth

    max width for the widget in pixels

    requiredSettings

    array of text_key values (matching those used in settingsMetadata) for the required settings for this chart

    settingsLocation

    path where the custom settings will be loaded/saved. If metadata is not found in that location, it will be read from the package (e.g. safetyGraphics::settingsMetadata), and then written to the specified location once the new chart has been added.

    overwrite

    overwrite any existing chart metadata? Note that having multiple charts with the same name is not supported and will cause unexpected results. default = true

    - -

    Details

    - -

    This function makes it easy for users to add a new chart to the safetyGraphics shiny app, by making updates to the underlying metadata used by the package. Specifically, the function adds a row to chartsMetadata.rda describing the chart and adds a column to settingsMetadata.rda specifying which settings are used with the chart. If new settings are needed for the chart, the user should call addSetting() for each new setting required.

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/addSetting.html b/docs/reference/addSetting.html deleted file mode 100644 index 088fce18..00000000 --- a/docs/reference/addSetting.html +++ /dev/null @@ -1,238 +0,0 @@ - - - - - - - - -Adds a new setting for use in the safetyGraphics shiny app — addSetting • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function updates settings objects to add a new setting parameter to the safetyGraphics shiny app

    - -
    - -
    addSetting(text_key, label, description, setting_type,
    -  setting_required = FALSE, column_mapping = FALSE, column_type = NA,
    -  field_mapping = FALSE, field_column_key = "", setting_cat,
    -  default = "", charts = c(), settingsLocation = getwd(),
    -  overwrite = TRUE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    text_key

    Text key indicating the setting name. '--' delimiter indicates a nested setting

    label

    Label

    description

    Description

    setting_type

    Expected type for setting value. Should be "character", "vector", "numeric" or "logical"

    setting_required

    Flag indicating if the setting is required

    column_mapping

    Flag indicating if the setting corresponds to a column in the associated data

    column_type

    Expected type for the data column values. Should be "character","logical" or "numeric"

    field_mapping

    Flag indicating whether the setting corresponds to a field-level mapping in the data

    field_column_key

    Key for the column that provides options for the field-level mapping in the data

    setting_cat

    Setting category (data, measure, appearance)

    default

    Default value for non-data settings

    charts

    character vector of charts using this setting

    settingsLocation

    path where the custom settings will be loaded/saved. If metadata is not found in that location, it will be read from the package (e.g. safetyGraphics::settingsMetadata), and then written to the specified location once the new setting has been added.

    overwrite

    overwrite any existing setting metadata? Note that having settings with the same name is not supported and will cause unexpected results. default = true

    - -

    Details

    - -

    This function makes it easy for users to adds a new settings to the safetyGraphics shiny app by making updates to the underlying metadata used by the package. Specifically, the function adds a row to settingsMetadata.rda describing the setting.

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/adlbc.html b/docs/reference/adlbc.html deleted file mode 100644 index 0a51fdc0..00000000 --- a/docs/reference/adlbc.html +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - -Safety measures sample data — adlbc • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    A dataset containing anonymized lab data from a clinical trial in the CDISC ADaM format. The structure is 1 record per measure per visit per participant. See a full description of the ADaM data standard here.

    - -
    - -
    adlbc
    - -

    Format

    - -

    A data frame with 10288 rows and 46 variables.

    -
    STUDYID

    Study Identifier

    -
    SUBJID

    Subject Identifier for the Study

    -
    USUBJID

    Unique Subject Identifier

    -
    TRTP

    Planned Treatment

    -
    TRTPN

    Planned Treatment (N)

    -
    TRTA

    Actual Treatment

    -
    TRTAN

    Actual Treatment (N)

    -
    TRTSDT

    Date of First Exposure to Treatment

    -
    TRTEDT

    Date of Last Exposure to Treatment

    -
    AGE

    Age

    -
    AGEGR1

    Age Group

    -
    AGEGR1N

    Age Group (N)

    -
    RACE

    Race

    -
    RACEN

    Race (N)

    -
    SEX

    Sex

    -
    COMP24FL

    Completers Flag

    -
    DSRAEFL

    Discontinued due to AE?

    -
    SAFFL

    Safety Population Flag

    -
    AVISIT

    Analysis Visit

    -
    AVISITN

    Analysis Visit (N)

    -
    ADY

    Analysis Relative Day

    -
    ADT

    Analysis Relative Date

    -
    VISIT

    Visit

    -
    VISITNUM

    Visit (N)

    -
    PARAM

    Parameter

    -
    PARAMCD

    Parameter Code

    -
    PARAMN

    Parameter (N)

    -
    PARCAT1

    Parameter Category

    -
    AVAL

    Analysis Value

    -
    BASE

    Baseline Value

    -
    CHG

    Change from Baseline

    -
    A1LO

    Analysis Normal Range Lower Limit

    -
    A1HI

    Analysis Normal Range Upper Limit

    -
    R2A1LO

    Ratio to Low limit of Analysis Range

    -
    R2A1HI

    Ratio to High limit of Analysis Range

    -
    BR2A1LO

    Base Ratio to Analysis Range 1 Lower Lim

    -
    BR2A1HI

    Base Ratio to Analysis Range 1 Upper Lim

    -
    ANL01FL

    Analysis Population Flag

    -
    ALBTRVAL

    Amount Threshold Range

    -
    ANRIND

    Analysis Reference Range Indicator

    -
    BNRIND

    Baseline Reference Range Indicator

    -
    ABLFL

    Baseline Record Flag

    -
    AENTMTFL

    Analysis End Date Flag

    -
    LBSEQ

    Lab Sequence Number

    -
    LBNRIND

    Reference Range Indicator

    -
    LBSTRESN

    Numeric Result/Finding in Std Units

    - -
    - -

    Source

    - -

    https://github.com/RhoInc/data-library

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/app_startup.html b/docs/reference/app_startup.html deleted file mode 100644 index 2acc008c..00000000 --- a/docs/reference/app_startup.html +++ /dev/null @@ -1,141 +0,0 @@ - -Startup code for shiny app — app_startup • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Prepare inputs for safetyGraphics app - run before app is initialized.

    -
    - -
    -
    app_startup(
    -  domainData = NULL,
    -  meta = NULL,
    -  charts = NULL,
    -  mapping = NULL,
    -  autoMapping = NULL,
    -  filterDomain = NULL,
    -  chartSettingsPaths = NULL
    -)
    -
    - -
    -

    Arguments

    -
    domainData
    -

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    -
    meta
    -

    data frame containing the metadata for use in the app. If no metadata is provided (default value is NULL), metatdata is generated by makeMeta().

    -
    charts
    -

    list of charts in the format produced by safetyGraphics::makeChartConfig()

    -
    mapping
    -

    list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    -
    autoMapping
    -

    boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the mapping parameter overwrite automatically generated mappings when both are found. Defaults to true.

    -
    filterDomain
    -

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    -
    chartSettingsPaths
    -

    path(s) where customization functions are saved relative to your working directory. All charts can have initialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.

    -
    -
    -

    Value

    -

    List of elements for used to initialize the shiny app with the following parameters

    • "meta" List of configuration metadata

    • -
    • "charts" List of charts

    • -
    • "domainData" List of domain level data sets

    • -
    • "mapping" Initial Data Mapping

    • -
    • "standards" List of domain level data standards

    • -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/chartRenderer-shiny.html b/docs/reference/chartRenderer-shiny.html deleted file mode 100644 index fdbfea35..00000000 --- a/docs/reference/chartRenderer-shiny.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - -Shiny bindings for chartRenderer — chartRenderer-shiny • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Output and render functions for using safetyhistogram within Shiny -applications and interactive Rmd documents.

    - -
    - -
    output_chartRenderer(outputId, width = "100%", height = "400px")
    -
    -render_chartRenderer(expr, env = parent.frame(), quoted = FALSE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    outputId

    output variable to read from

    width, height

    Must be a valid CSS unit (like '100%', -'400px', 'auto') or a number, which will be coerced to a -string and have 'px' appended.

    expr

    An expression that generates a chart

    env

    The environment in which to evaluate expr.

    quoted

    Is expr a quoted expression (with quote())? This -is useful if you want to save an expression in a variable.

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/chartRenderer.html b/docs/reference/chartRenderer.html deleted file mode 100644 index 2233feab..00000000 --- a/docs/reference/chartRenderer.html +++ /dev/null @@ -1,220 +0,0 @@ - - - - - - - - -Create an interactive graphics widget — chartRenderer • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function creates an nice interactive widget. See the vignettes for more details regarding how to customize charts.

    - -
    - -
    chartRenderer(data, debug_js = FALSE, settings = NULL, chart = 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.

    debug_js

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

    settings

    Optional list of settings arguments to be converted to JSON using jsonlite::toJSON(settings, auto_unbox = TRUE, dataframe = "rows", null = "null"). Default: NULL.

    chart

    name of the chart to render

    - - -

    Examples

    -
    if (FALSE) { - -## Create Histogram figure using a premade settings list -details_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", - unit_col = "PARAMCD", - normal_col_low = "A1LO", - normal_col_high = "A1HI", - details = details_list, - filters = filters_list) - -chartRenderer(data=adlbc, settings = settingsl, chart=safetyhistogram) - -}
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/chartsMetadata.html b/docs/reference/chartsMetadata.html deleted file mode 100644 index 6ba98e57..00000000 --- a/docs/reference/chartsMetadata.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - - - - -Charts Metadata — chartsMetadata • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Metadata about the charts available in the shiny app

    - -
    - -
    chartsMetadata
    - -

    Format

    - -

    A data frame with 29 rows and 7 columns

    -
    chart

    Name of the chart - one word, all lower case

    -
    label

    Nicely formatted name of the chart

    -
    description

    Description of the chart

    -
    repo_url

    Homepage for chart's code repository (if any)

    -
    settings_url

    Homepage for chart's settings documentation

    -
    main

    Name of the main function used to initialize the app. The function must accept "location" and "settings" parameters (in that order) and have an .init() method, expecting a json data array.

    -
    type

    type of chart (e.g. 'htmlwidget')

    -
    maxWidth

    max width for the widget in pixels

    - -
    - -

    Source

    - -

    Created for this package

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/chartsNav.html b/docs/reference/chartsNav.html deleted file mode 100644 index b567b70a..00000000 --- a/docs/reference/chartsNav.html +++ /dev/null @@ -1,115 +0,0 @@ - -Adds a navbar tab that initializes the Chart Module UI — chartsNav • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Adds a navbar tab that initializes the Chart Module UI

    -
    - -
    -
    chartsNav(chart, ns)
    -
    - -
    -

    Arguments

    -
    chart
    -

    chart metadata

    -
    ns
    -

    namespace

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/chartsTab.html b/docs/reference/chartsTab.html deleted file mode 100644 index c8966ff7..00000000 --- a/docs/reference/chartsTab.html +++ /dev/null @@ -1,123 +0,0 @@ - -Server for chart module, designed to be re-used for each chart generated. — chartsTab • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for chart module, designed to be re-used for each chart generated.

    -
    - -
    -
    chartsTab(input, output, session, chart, data, mapping)
    -
    - -
    -

    Arguments

    -
    input
    -

    Input objects from module namespace

    -
    output
    -

    Output objects from module namespace

    -
    session
    -

    An environment that can be used to access information and functionality relating to the session

    -
    chart
    -

    list containing a safetyGraphics chart object like those returned by makeChartConfig.

    -
    data
    -

    named list of current data sets (Reactive).

    -
    mapping
    -

    tibble capturing the current data mappings (Reactive).

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/chartsTabUI.html b/docs/reference/chartsTabUI.html deleted file mode 100644 index 779c8cd5..00000000 --- a/docs/reference/chartsTabUI.html +++ /dev/null @@ -1,115 +0,0 @@ - -UI for chart module, designed to be re-used for each chart generated. — chartsTabUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for chart module, designed to be re-used for each chart generated.

    -
    - -
    -
    chartsTabUI(id, chart)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    chart
    -

    list containing chart specifications like those returned by makeChartConfig.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/checkColumn.html b/docs/reference/checkColumn.html deleted file mode 100644 index 4cb97f7e..00000000 --- a/docs/reference/checkColumn.html +++ /dev/null @@ -1,323 +0,0 @@ - - - - - - - - -Check that a setting parameter has a matching data column — checkColumn • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Checks that a single parameter from the settings list matches a column name in a specified data set

    - -
    - -
    checkColumn(key, settings, data)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    key

    a list (like those provided by getSettingKeys()) defining the position of parameter in the settings object.

    settings

    The settings list used to generate a chart like eDISH()

    data

    A data frame to check for the specified column

    - -

    Value

    - -

    A list containing the results of the check following the format specified in validateSettings()[["checkList"]]

    - -

    Details

    - -

    This function compares settings with column names as part of the validateSettings() function. More specifically, the function checks whether the key in a settings object matches a column in "data".

    - - -

    Examples

    -
    testSettings<-generateSettings(standard="AdAM") -testSettings$filters<-list() -testSettings$filters[[1]]<-list(value_col="RACE",label="Race") -testSettings$filters[[2]]<-list(value_col=NULL,label="No Column") -testSettings$filters[[3]]<-list(value_col="NotAColumn",label="Invalid Column") - -#pass ($valid == TRUE) -safetyGraphics:::checkColumn(key=list("id_col"), - settings=testSettings, adlbc)
    #> $key -#> $key[[1]] -#> [1] "id_col" -#> -#> -#> $text_key -#> [1] "id_col" -#> -#> $type -#> [1] "column" -#> -#> $description -#> [1] "column parameter from setting setting found in data?" -#> -#> $value -#> [1] "USUBJID" -#> -#> $valid -#> [1] TRUE -#> -#> $message -#> [1] "" -#>
    -#pass -safetyGraphics:::checkColumn(key=list("filters",1,"value_col"), - settings=testSettings, adlbc)
    #> $key -#> $key[[1]] -#> [1] "filters" -#> -#> $key[[2]] -#> [1] 1 -#> -#> $key[[3]] -#> [1] "value_col" -#> -#> -#> $text_key -#> [1] "filters--1--value_col" -#> -#> $type -#> [1] "column" -#> -#> $description -#> [1] "column parameter from setting setting found in data?" -#> -#> $value -#> [1] "RACE" -#> -#> $valid -#> [1] TRUE -#> -#> $message -#> [1] "" -#>
    -#NULL column pass -safetyGraphics:::checkColumn(key=list("filters",2,"value_col"), - settings=testSettings, adlbc)
    #> $key -#> $key[[1]] -#> [1] "filters" -#> -#> $key[[2]] -#> [1] 2 -#> -#> $key[[3]] -#> [1] "value_col" -#> -#> -#> $text_key -#> [1] "filters--2--value_col" -#> -#> $type -#> [1] "column" -#> -#> $description -#> [1] "column parameter from setting setting found in data?" -#> -#> $value -#> [1] "--No Value Given--" -#> -#> $valid -#> [1] TRUE -#> -#> $message -#> [1] "" -#>
    -#invalid column fails -safetyGraphics:::checkColumn(key=list("filters",3,"value_col"), - settings=testSettings, adlbc)
    #> $key -#> $key[[1]] -#> [1] "filters" -#> -#> $key[[2]] -#> [1] 3 -#> -#> $key[[3]] -#> [1] "value_col" -#> -#> -#> $text_key -#> [1] "filters--3--value_col" -#> -#> $type -#> [1] "column" -#> -#> $description -#> [1] "column parameter from setting setting found in data?" -#> -#> $value -#> [1] "NotAColumn" -#> -#> $valid -#> [1] FALSE -#> -#> $message -#> [1] "NotAColumn column not found in data." -#>
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/checkField.html b/docs/reference/checkField.html deleted file mode 100644 index 2a6e3f81..00000000 --- a/docs/reference/checkField.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - -Check that a setting parameter has a matching data field — checkField • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Checks that a single parameter from the settings list matches a field value in a specified data set

    - -
    - -
    checkField(fieldKey, settings, data)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    fieldKey

    a list (like those provided by getSettingKeys()) defining the position of parameter in the settings object.

    settings

    The settings list used to generate a chart like eDISH()

    data

    A data frame to check for the specified field

    - -

    Value

    - -

    A list containing the results of the check following the format specified in validateSettings()[["checkList"]]

    - -

    Details

    - -

    This function compares settings with field values as part of the validateSettings() function. More specifically, the function checks whether the fieldKey in a settings object matches a column/field combination in "data". The function makes 2 major assumptions about the structure of the settings object. First, it assumes that the first value in fieldKey is "settingName_values" and there is a corresponding "settingName_col" setting that defines the column to search for field-level data. Second, it expects that the value specified by key/settings is a list, and that each value in the list is a field of the variable above.

    - - -

    Examples

    -
    testSettings<-generateSettings(standard="AdAM") -fields<-list("measure_values","TB") -safetyGraphics:::checkField(fieldKey=fields,settings=testSettings, data=adlbc)
    #> $key -#> $key[[1]] -#> [1] "measure_values" -#> -#> $key[[2]] -#> [1] "TB" -#> -#> -#> $text_key -#> [1] "measure_values--TB" -#> -#> $type -#> [1] "field value from setting found in data" -#> -#> $description -#> [1] "field value from setting found in data" -#> -#> $value -#> [1] "Bilirubin (umol/L)" -#> -#> $valid -#> [1] TRUE -#> -#> $message -#> [1] "" -#>
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/checkNumeric.html b/docs/reference/checkNumeric.html deleted file mode 100644 index 589109dc..00000000 --- a/docs/reference/checkNumeric.html +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - -Check that settings for mapping numeric data are associated with numeric columns — checkNumeric • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Check that settings for mapping numeric data are associated with numeric columns

    - -
    - -
    checkNumeric(key, settings, data)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    key

    a list (like those provided by getSettingKeys()) defining the position of parameter in the settings object.

    settings

    The settings list used to generate a chart like eDISH()

    data

    A data frame to check for the specified numeric column

    - -

    Value

    - -

    A list containing the results of the check following the format specified in validateSettings()[["checkList"]]

    - - -

    Examples

    -
    testSettings<-generateSettings(standard="AdAM") -#pass ($valid == FALSE) -safetyGraphics:::checkNumeric(key=list("id_col"),settings=testSettings, data=adlbc)
    #> $key -#> $key[[1]] -#> [1] "id_col" -#> -#> -#> $text_key -#> [1] "id_col" -#> -#> $type -#> [1] "numeric" -#> -#> $description -#> [1] "specified column is numeric?" -#> -#> $value -#> [1] "USUBJID" -#> -#> $valid -#> [1] FALSE -#> -#> $message -#> [1] "10288 of 10288 values were not numeric. Records with non-numeric values may not appear in the graphic." -#>
    -#pass ($valid == TRUE) -safetyGraphics:::checkNumeric(key=list("value_col"),settings=testSettings, data=adlbc)
    #> $key -#> $key[[1]] -#> [1] "value_col" -#> -#> -#> $text_key -#> [1] "value_col" -#> -#> $type -#> [1] "numeric" -#> -#> $description -#> [1] "specified column is numeric?" -#> -#> $value -#> [1] "AVAL" -#> -#> $valid -#> [1] TRUE -#> -#> $message -#> [1] "9 of 10288 values were not numeric. Records with non-numeric values may not appear in the graphic." -#>
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/checkRequired.html b/docs/reference/checkRequired.html deleted file mode 100644 index 5771e265..00000000 --- a/docs/reference/checkRequired.html +++ /dev/null @@ -1,272 +0,0 @@ - - - - - - - - -Check that the user has provided a valid for a given settings parameter — checkRequired • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Checks that a single required parameter from the settings list is provided by the user

    - -
    - -
    checkRequired(key, settings)
    - -

    Arguments

    - - - - - - - - - - -
    key

    a list (like those provided by getSettingKeys()) defining the position of parameter in the settings object.

    settings

    The settings list used to generate a chart like eDISH()

    - -

    Value

    - -

    A list containing the results of the check following the format specified in validateSettings()[["checkList"]]

    - - -

    Examples

    -
    testSettings<-generateSettings(standard="AdAM") - -#pass ($valid == TRUE) -safetyGraphics:::checkRequired(key=list("id_col"), - settings=testSettings)
    #> $key -#> $key[[1]] -#> [1] "id_col" -#> -#> -#> $text_key -#> [1] "id_col" -#> -#> $type -#> [1] "required" -#> -#> $description -#> [1] "value for specified key found in settings?" -#> -#> $value -#> [1] "USUBJID" -#> -#> $valid -#> [1] TRUE -#> -#> $message -#> [1] "" -#>
    -#fails since filters aren't specified by default -safetyGraphics:::checkRequired(key=list("filters"), - settings=testSettings)
    #> $key -#> $key[[1]] -#> [1] "filters" -#> -#> -#> $text_key -#> [1] "filters" -#> -#> $type -#> [1] "required" -#> -#> $description -#> [1] "value for specified key found in settings?" -#> -#> $value -#> [1] "--No Value Given--" -#> -#> $valid -#> [1] FALSE -#> -#> $message -#> [1] "filters not specified in settings." -#>
    -#fails since groups aren't specified by default -safetyGraphics:::checkRequired(key=list("groups",1,"value_col"), - settings=testSettings)
    #> $key -#> $key[[1]] -#> [1] "groups" -#> -#> $key[[2]] -#> [1] 1 -#> -#> $key[[3]] -#> [1] "value_col" -#> -#> -#> $text_key -#> [1] "groups--1--value_col" -#> -#> $type -#> [1] "required" -#> -#> $description -#> [1] "value for specified key found in settings?" -#> -#> $value -#> [1] "--No Value Given--" -#> -#> $valid -#> [1] FALSE -#> -#> $message -#> [1] "groups--1--value_col not specified in settings." -#>
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/createChart.html b/docs/reference/createChart.html deleted file mode 100644 index cf3819cd..00000000 --- a/docs/reference/createChart.html +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - - - -Create a custom static or plotly R graphic — createChart • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Create a custom static or plotly R graphic

    - -
    - -
    createChart(type, rSettings)
    - -

    Arguments

    - - - - - - - - - - -
    type

    Type of chart. Options are "static" or plotly.

    rSettings

    List containing all arguments needed for chart creation: -rSettings = list( -data = data, -debug_js=debug_js, -chartFunction = chartFunction, -settings = jsonlite::toJSON( - settings, - auto_unbox = TRUE, - null = "null" -))

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/detectStandard.html b/docs/reference/detectStandard.html deleted file mode 100644 index 85892c9b..00000000 --- a/docs/reference/detectStandard.html +++ /dev/null @@ -1,337 +0,0 @@ - -Detect the data standard used for a data set — detectStandard • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    This function attempts to detect the clinical data standard used in a given R data frame.

    -
    - -
    -
    detectStandard(data, domain = NULL, meta = NULL)
    -
    - -
    -

    Arguments

    -
    data
    -

    A data frame in which to detect the data standard - required.

    -
    domain
    -

    the domain to evaluate - should match a value of meta$domain. Uses the first value in meta$domain if no value is provided.

    -
    meta
    -

    the metadata containing the data standards.

    -
    -
    -

    Value

    -

    A data frame describing the detected standard for each "text_key" in the provided metadata. Columns are "domain", "text_key", "column" and "standard".

    -
    -
    -

    Details

    -

    This function compares the columns in the provided "data" with the required columns for a given data standard/domain combination. The function is designed to work with the SDTM and ADaM CDISC(https://www.cdisc.org/) standards for clinical trial data by default. Additional standards can be added by modifying the "meta" data set included as part of this package.

    -
    - -
    -

    Examples

    -
    detectStandard(data=safetyData::adam_adae, meta=safetyCharts::meta_aes) 
    -#> $details
    -#> $details$adam
    -#> $details$adam$standard
    -#> [1] "adam"
    -#> 
    -#> $details$adam$mapping
    -#> # A tibble: 8 × 3
    -#> # Rowwise: 
    -#>   text_key     current  valid
    -#>   <chr>        <chr>    <lgl>
    -#> 1 id_col       USUBJID  TRUE 
    -#> 2 seq_col      AESEQ    TRUE 
    -#> 3 stdy_col     ASTDY    TRUE 
    -#> 4 endy_col     AENDY    TRUE 
    -#> 5 term_col     AEDECOD  TRUE 
    -#> 6 bodsys_col   AEBODSYS TRUE 
    -#> 7 severity_col AESEV    TRUE 
    -#> 8 serious_col  AESER    TRUE 
    -#> 
    -#> $details$adam$total_count
    -#> [1] 8
    -#> 
    -#> $details$adam$valid_count
    -#> [1] 8
    -#> 
    -#> $details$adam$invalid_count
    -#> [1] 0
    -#> 
    -#> $details$adam$match_percent
    -#> [1] 1
    -#> 
    -#> $details$adam$match
    -#> [1] "full"
    -#> 
    -#> $details$adam$label
    -#> [1] "ADaM"
    -#> 
    -#> 
    -#> $details$sdtm
    -#> $details$sdtm$standard
    -#> [1] "sdtm"
    -#> 
    -#> $details$sdtm$mapping
    -#> # A tibble: 8 × 3
    -#> # Rowwise: 
    -#>   text_key     current  valid
    -#>   <chr>        <chr>    <lgl>
    -#> 1 id_col       USUBJID  TRUE 
    -#> 2 seq_col      AESEQ    TRUE 
    -#> 3 stdy_col     NA       FALSE
    -#> 4 endy_col     NA       FALSE
    -#> 5 term_col     AEDECOD  TRUE 
    -#> 6 bodsys_col   AEBODSYS TRUE 
    -#> 7 severity_col AESEV    TRUE 
    -#> 8 serious_col  AESER    TRUE 
    -#> 
    -#> $details$sdtm$total_count
    -#> [1] 8
    -#> 
    -#> $details$sdtm$valid_count
    -#> [1] 6
    -#> 
    -#> $details$sdtm$invalid_count
    -#> [1] 2
    -#> 
    -#> $details$sdtm$match_percent
    -#> [1] 0.75
    -#> 
    -#> $details$sdtm$match
    -#> [1] "partial"
    -#> 
    -#> $details$sdtm$label
    -#> [1] "Partial SDTM"
    -#> 
    -#> $details$sdtm$details
    -#> [1] "(6/8 cols/fields matched)"
    -#> 
    -#> 
    -#> 
    -#> $standard
    -#> [1] "adam"
    -#> 
    -#> $label
    -#> [1] "ADaM"
    -#> 
    -#> $standard_percent
    -#> [1] 1
    -#> 
    -#> $mapping
    -#> # A tibble: 8 × 3
    -#> # Rowwise: 
    -#>   text_key     current  valid
    -#>   <chr>        <chr>    <lgl>
    -#> 1 id_col       USUBJID  TRUE 
    -#> 2 seq_col      AESEQ    TRUE 
    -#> 3 stdy_col     ASTDY    TRUE 
    -#> 4 endy_col     AENDY    TRUE 
    -#> 5 term_col     AEDECOD  TRUE 
    -#> 6 bodsys_col   AEBODSYS TRUE 
    -#> 7 severity_col AESEV    TRUE 
    -#> 8 serious_col  AESER    TRUE 
    -#> 
    -detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs, domain="labs" ) 
    -#> $details
    -#> $details$adam
    -#> $details$adam$standard
    -#> [1] "adam"
    -#> 
    -#> $details$adam$mapping
    -#> # A tibble: 8 × 3
    -#> # Rowwise: 
    -#>   text_key        current  valid
    -#>   <chr>           <chr>    <lgl>
    -#> 1 id_col          USUBJID  TRUE 
    -#> 2 value_col       AVAL     TRUE 
    -#> 3 measure_col     PARAM    TRUE 
    -#> 4 normal_col_low  A1LO     TRUE 
    -#> 5 normal_col_high A1HI     TRUE 
    -#> 6 studyday_col    ADY      TRUE 
    -#> 7 visit_col       VISIT    TRUE 
    -#> 8 visitn_col      VISITNUM TRUE 
    -#> 
    -#> $details$adam$total_count
    -#> [1] 8
    -#> 
    -#> $details$adam$valid_count
    -#> [1] 8
    -#> 
    -#> $details$adam$invalid_count
    -#> [1] 0
    -#> 
    -#> $details$adam$match_percent
    -#> [1] 1
    -#> 
    -#> $details$adam$match
    -#> [1] "full"
    -#> 
    -#> $details$adam$label
    -#> [1] "ADaM"
    -#> 
    -#> 
    -#> $details$sdtm
    -#> $details$sdtm$standard
    -#> [1] "sdtm"
    -#> 
    -#> $details$sdtm$mapping
    -#> # A tibble: 9 × 3
    -#> # Rowwise: 
    -#>   text_key        current  valid
    -#>   <chr>           <chr>    <lgl>
    -#> 1 id_col          USUBJID  TRUE 
    -#> 2 value_col       LBSTRESN TRUE 
    -#> 3 measure_col     NA       FALSE
    -#> 4 normal_col_low  NA       FALSE
    -#> 5 normal_col_high NA       FALSE
    -#> 6 studyday_col    NA       FALSE
    -#> 7 visit_col       VISIT    TRUE 
    -#> 8 visitn_col      VISITNUM TRUE 
    -#> 9 unit_col        NA       FALSE
    -#> 
    -#> $details$sdtm$total_count
    -#> [1] 9
    -#> 
    -#> $details$sdtm$valid_count
    -#> [1] 4
    -#> 
    -#> $details$sdtm$invalid_count
    -#> [1] 5
    -#> 
    -#> $details$sdtm$match_percent
    -#> [1] 0.4444444
    -#> 
    -#> $details$sdtm$match
    -#> [1] "partial"
    -#> 
    -#> $details$sdtm$label
    -#> [1] "Partial SDTM"
    -#> 
    -#> $details$sdtm$details
    -#> [1] "(4/9 cols/fields matched)"
    -#> 
    -#> 
    -#> 
    -#> $standard
    -#> [1] "adam"
    -#> 
    -#> $label
    -#> [1] "ADaM"
    -#> 
    -#> $standard_percent
    -#> [1] 1
    -#> 
    -#> $mapping
    -#> # A tibble: 8 × 3
    -#> # Rowwise: 
    -#>   text_key        current  valid
    -#>   <chr>           <chr>    <lgl>
    -#> 1 id_col          USUBJID  TRUE 
    -#> 2 value_col       AVAL     TRUE 
    -#> 3 measure_col     PARAM    TRUE 
    -#> 4 normal_col_low  A1LO     TRUE 
    -#> 5 normal_col_high A1HI     TRUE 
    -#> 6 studyday_col    ADY      TRUE 
    -#> 7 visit_col       VISIT    TRUE 
    -#> 8 visitn_col      VISITNUM TRUE 
    -#> 
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/evaluateStandard.html b/docs/reference/evaluateStandard.html deleted file mode 100644 index a4a199f4..00000000 --- a/docs/reference/evaluateStandard.html +++ /dev/null @@ -1,217 +0,0 @@ - -Evaluate a data set against a data standard — evaluateStandard • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Determines whether the required data elements in a data standard are found in a given data frame

    -
    - -
    -
    evaluateStandard(data, meta, domain, standard)
    -
    - -
    -

    Arguments

    -
    data
    -

    A data frame in which to detect the data standard

    -
    meta
    -

    the metadata containing the data standards.

    -
    domain
    -

    the domain to evaluate - should match a value of meta$domain

    -
    standard
    -

    standard to evaluate

    -
    -
    -

    Value

    -

    a list describing to what degree the data set matches the data standard. The "match" property describes compliance with the standard as "full", "partial" or "none". The "checks" property is a list of the data elements expected for the standard and whether they are "valid" in the given data set. "total_checks", "valid_checks" and "invalid_checks" provide counts of the specified checks. "match_percent" is calculated as valid_checks/total_checks. "mapping" is a data frame describing the detected standard for each "text_key" in the provided metadata. Columns are "text_key", "current" containing the name of the matched column or field value in the data and "match" a boolean indicating whether the data matches the standard.

    -
    - -
    -

    Examples

    -
    # Match is TRUE
    -evaluateStandard(
    - data=safetyData::adam_adlbc, 
    - meta=safetyCharts::meta_labs, 
    - domain="labs", 
    - standard="adam"
    -) 
    -#> $standard
    -#> [1] "adam"
    -#> 
    -#> $mapping
    -#> # A tibble: 8 × 3
    -#> # Rowwise: 
    -#>   text_key        current  valid
    -#>   <chr>           <chr>    <lgl>
    -#> 1 id_col          USUBJID  TRUE 
    -#> 2 value_col       AVAL     TRUE 
    -#> 3 measure_col     PARAM    TRUE 
    -#> 4 normal_col_low  A1LO     TRUE 
    -#> 5 normal_col_high A1HI     TRUE 
    -#> 6 studyday_col    ADY      TRUE 
    -#> 7 visit_col       VISIT    TRUE 
    -#> 8 visitn_col      VISITNUM TRUE 
    -#> 
    -#> $total_count
    -#> [1] 8
    -#> 
    -#> $valid_count
    -#> [1] 8
    -#> 
    -#> $invalid_count
    -#> [1] 0
    -#> 
    -#> $match_percent
    -#> [1] 1
    -#> 
    -#> $match
    -#> [1] "full"
    -#> 
    -#> $label
    -#> [1] "ADaM"
    -#> 
    -
    -# Match is FALSE
    -evaluateStandard(
    - data=safetyData::adam_adlbc, 
    - meta=safetyCharts::meta_labs, 
    - domain="labs", 
    - standard="sdtm"
    -) 
    -#> $standard
    -#> [1] "sdtm"
    -#> 
    -#> $mapping
    -#> # A tibble: 9 × 3
    -#> # Rowwise: 
    -#>   text_key        current  valid
    -#>   <chr>           <chr>    <lgl>
    -#> 1 id_col          USUBJID  TRUE 
    -#> 2 value_col       LBSTRESN TRUE 
    -#> 3 measure_col     NA       FALSE
    -#> 4 normal_col_low  NA       FALSE
    -#> 5 normal_col_high NA       FALSE
    -#> 6 studyday_col    NA       FALSE
    -#> 7 visit_col       VISIT    TRUE 
    -#> 8 visitn_col      VISITNUM TRUE 
    -#> 9 unit_col        NA       FALSE
    -#> 
    -#> $total_count
    -#> [1] 9
    -#> 
    -#> $valid_count
    -#> [1] 4
    -#> 
    -#> $invalid_count
    -#> [1] 5
    -#> 
    -#> $match_percent
    -#> [1] 0.4444444
    -#> 
    -#> $match
    -#> [1] "partial"
    -#> 
    -#> $label
    -#> [1] "Partial SDTM"
    -#> 
    -#> $details
    -#> [1] "(4/9 cols/fields matched)"
    -#> 
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/filterTab.html b/docs/reference/filterTab.html deleted file mode 100644 index 5b60c5b9..00000000 --- a/docs/reference/filterTab.html +++ /dev/null @@ -1,140 +0,0 @@ - -Server for the filter module in datamods::filter_data_ui — filterTab • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for the filter module in datamods::filter_data_ui

    -
    - -
    -
    filterTab(
    -  input,
    -  output,
    -  session,
    -  domainData,
    -  filterDomain,
    -  current_mapping,
    -  tabID = "Filtering",
    -  filterVars = NULL
    -)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    domainData
    -

    list of data files for each domain

    -
    filterDomain
    -

    domain to use for filtering (typically "dm")

    -
    current_mapping
    -

    current data mapping

    -
    tabID
    -

    ID for the tab containing the filter UI (used for testing)

    -
    filterVars
    -

    Variables to use for filtering (used for testing)

    -
    -
    -

    Value

    -

    filtered data set

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/filterTabChecks.html b/docs/reference/filterTabChecks.html deleted file mode 100644 index 1236d90a..00000000 --- a/docs/reference/filterTabChecks.html +++ /dev/null @@ -1,121 +0,0 @@ - -Checks for whether the current data and settings support a filter tab — filterTabChecks • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Checks for whether the current data and settings support a filter tab

    -
    - -
    -
    filterTabChecks(domainData, filterDomain, current_mapping)
    -
    - -
    -

    Arguments

    -
    domainData
    -

    list of data files for each domain

    -
    filterDomain
    -

    domain to use for filtering (typically "dm")

    -
    current_mapping
    -

    current data mapping (REACTIVE)

    -
    -
    -

    Value

    -

    reactive that returns a boolean indicating whether the checks passed and filtering can be initialized

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/filterTabUI.html b/docs/reference/filterTabUI.html deleted file mode 100644 index a51a4075..00000000 --- a/docs/reference/filterTabUI.html +++ /dev/null @@ -1,113 +0,0 @@ - -UI for the filter module in datamods::filter_data_ui — filterTabUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for the filter module in datamods::filter_data_ui

    -
    - -
    -
    filterTabUI(id)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/generateMappingList.html b/docs/reference/generateMappingList.html deleted file mode 100644 index 312828f6..00000000 --- a/docs/reference/generateMappingList.html +++ /dev/null @@ -1,117 +0,0 @@ - -Convert mapping data.frame to a list — generateMappingList • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Convert mapping data.frame to a list

    -
    - -
    -
    generateMappingList(settingsDF, domain = NULL, pull = FALSE)
    -
    - -
    -

    Arguments

    -
    settingsDF
    -

    data frame containing current mapping

    -
    domain
    -

    mapping domain to return (returns all domains as a named list by default)

    -
    pull
    -

    call pull() the value for each parameter - needed for testing only. default: FALSE

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/generateSettings.html b/docs/reference/generateSettings.html deleted file mode 100644 index 70170b6f..00000000 --- a/docs/reference/generateSettings.html +++ /dev/null @@ -1,739 +0,0 @@ - - - - - - - - -Generate a settings object based on a data standard — generateSettings • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function returns a settings object for the eDish chart based on the specified data standard.

    - -
    - -
    generateSettings(standard = "None", charts = NULL,
    -  useDefaults = TRUE, partial = FALSE, partial_keys = NULL,
    -  custom_settings = NULL)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    standard

    The data standard for which to create settings. Valid options are "sdtm", "adam" or "none". Default: "None".

    charts

    The chart or charts for which settings should be generated. Default: NULL (uses all available charts).

    useDefaults

    Specifies whether default values from settingsMetadata should be included in the settings object. Default: TRUE.

    partial

    Boolean for whether or not the standard is a partial standard. Default: FALSE.

    partial_keys

    Optional character vector of the matched settings if partial is TRUE. Settings should be identified using the text_key format described in ?settingsMetadata. Setting is ignored when partial is FALSE. Default: NULL.

    custom_settings

    A tibble describing custom settings to be added to the settings object. Custom values overwrite default values when provided. Tibble should have text_key and customValue columns. Default: NULL.

    - -

    Value

    - -

    A list containing the appropriate settings for the selected chart

    - -

    Details

    - -

    The function is designed to work with the SDTM and ADaM CDISC(<https://www.cdisc.org/>) standards for clinical trial data. Currently, eDish is the only chart supported.

    - - -

    Examples

    -
    -generateSettings(standard="SDTM")
    #> $id_col -#> [1] "USUBJID" -#> -#> $value_col -#> [1] "STRESN" -#> -#> $measure_col -#> [1] "TEST" -#> -#> $measure_values -#> $measure_values$ALT -#> [1] "Aminotransferase, alanine (ALT)" -#> -#> $measure_values$AST -#> [1] "Aminotransferase, aspartate (AST)" -#> -#> $measure_values$TB -#> [1] "Total Bilirubin" -#> -#> $measure_values$ALP -#> [1] "Alkaline phosphatase (ALP)" -#> -#> -#> $normal_col_low -#> [1] "STNRLO" -#> -#> $normal_col_high -#> [1] "STNRHI" -#> -#> $studyday_col -#> [1] "DY" -#> -#> $visit_col -#> [1] "VISIT" -#> -#> $visitn_col -#> [1] "VISITNUM" -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#>
    generateSettings(standard="SdTm") #also ok
    #> $id_col -#> [1] "USUBJID" -#> -#> $value_col -#> [1] "STRESN" -#> -#> $measure_col -#> [1] "TEST" -#> -#> $measure_values -#> $measure_values$ALT -#> [1] "Aminotransferase, alanine (ALT)" -#> -#> $measure_values$AST -#> [1] "Aminotransferase, aspartate (AST)" -#> -#> $measure_values$TB -#> [1] "Total Bilirubin" -#> -#> $measure_values$ALP -#> [1] "Alkaline phosphatase (ALP)" -#> -#> -#> $normal_col_low -#> [1] "STNRLO" -#> -#> $normal_col_high -#> [1] "STNRHI" -#> -#> $studyday_col -#> [1] "DY" -#> -#> $visit_col -#> [1] "VISIT" -#> -#> $visitn_col -#> [1] "VISITNUM" -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#>
    generateSettings(standard="ADaM")
    #> $id_col -#> [1] "USUBJID" -#> -#> $value_col -#> [1] "AVAL" -#> -#> $measure_col -#> [1] "PARAM" -#> -#> $measure_values -#> $measure_values$ALT -#> [1] "Alanine Aminotransferase (U/L)" -#> -#> $measure_values$AST -#> [1] "Aspartate Aminotransferase (U/L)" -#> -#> $measure_values$TB -#> [1] "Bilirubin (umol/L)" -#> -#> $measure_values$ALP -#> [1] "Alkaline Phosphatase (U/L)" -#> -#> -#> $normal_col_low -#> [1] "A1LO" -#> -#> $normal_col_high -#> [1] "A1HI" -#> -#> $studyday_col -#> [1] "ADY" -#> -#> $visit_col -#> [1] "VISIT" -#> -#> $visitn_col -#> [1] "VISITNUM" -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#>
    pkeys<- c("id_col","measure_col","value_col") -generateSettings(standard="adam", partial=TRUE, partial_keys=pkeys)
    #> $id_col -#> [1] "USUBJID" -#> -#> $value_col -#> [1] "AVAL" -#> -#> $measure_col -#> [1] "PARAM" -#> -#> $measure_values -#> $measure_values$ALT -#> NULL -#> -#> $measure_values$AST -#> NULL -#> -#> $measure_values$TB -#> NULL -#> -#> $measure_values$ALP -#> NULL -#> -#> -#> $normal_col_low -#> NULL -#> -#> $normal_col_high -#> NULL -#> -#> $studyday_col -#> NULL -#> -#> $visit_col -#> NULL -#> -#> $visitn_col -#> NULL -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#>
    -generateSettings(standard="a different standard")
    #> $id_col -#> NULL -#> -#> $value_col -#> NULL -#> -#> $measure_col -#> NULL -#> -#> $measure_values -#> $measure_values$ALT -#> NULL -#> -#> $measure_values$AST -#> NULL -#> -#> $measure_values$TB -#> NULL -#> -#> $measure_values$ALP -#> NULL -#> -#> -#> $normal_col_low -#> NULL -#> -#> $normal_col_high -#> NULL -#> -#> $studyday_col -#> NULL -#> -#> $visit_col -#> NULL -#> -#> $visitn_col -#> NULL -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#>
    #returns shell settings list with no data mapping - -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/generateShell.html b/docs/reference/generateShell.html deleted file mode 100644 index 2381b73a..00000000 --- a/docs/reference/generateShell.html +++ /dev/null @@ -1,280 +0,0 @@ - - - - - - - - -Generate a default settings shell based on settings metadata — generateShell • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function returns a default settings object based on the chart(s) specified.

    - -
    - -
    generateShell(charts = NULL)
    - -

    Arguments

    - - - - - - -
    charts

    The chart or chart(s) to include in the shell settings object

    - -

    Value

    - -

    A list containing a setting shell (all values = NA) for the selected chart(s)

    - -

    Details

    - -

    The function is designed to work with valid safetyGraphics charts.

    - - -

    Examples

    -
    -safetyGraphics:::generateShell(charts = "hepexplorer")
    #> $id_col -#> NULL -#> -#> $value_col -#> NULL -#> -#> $measure_col -#> NULL -#> -#> $measure_values -#> $measure_values$ALT -#> NULL -#> -#> $measure_values$AST -#> NULL -#> -#> $measure_values$TB -#> NULL -#> -#> $measure_values$ALP -#> NULL -#> -#> -#> $normal_col_low -#> NULL -#> -#> $normal_col_high -#> NULL -#> -#> $studyday_col -#> NULL -#> -#> $visit_col -#> NULL -#> -#> $visitn_col -#> NULL -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> NULL -#> -#> $y_options -#> NULL -#> -#> $visit_window -#> NULL -#> -#> $r_ratio_filter -#> NULL -#> -#> $r_ratio_cut -#> NULL -#> -#> $showTitle -#> NULL -#> -#> $warningText -#> NULL -#> -#> $details -#> NULL -#> -#> $calculate_palt -#> NULL -#>
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/getRequiredSettings.html b/docs/reference/getRequiredSettings.html deleted file mode 100644 index 6052a7cf..00000000 --- a/docs/reference/getRequiredSettings.html +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - - - -Get a list of required settings — getRequiredSettings • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Get a list of required settings for a given chart

    - -
    - -
    getRequiredSettings(charts = NULL,
    -  metadata = safetyGraphics::settingsMetadata)
    - -

    Arguments

    - - - - - - - - - - -
    charts

    The chart for which required settings should be returned ("eDish" only for now) . Default: NULL (uses all available charts).

    metadata

    The metadata file to be used (primarily used for testing)

    - -

    Value

    - -

    List of lists specifying the position of matching named elements in the format list("filters",2,"value_col"), which would correspond to settings[["filters"]][[2]][["value_col"]].

    - - -

    Examples

    -
    safetyGraphics:::getRequiredSettings(charts=c("edish","safetyHistogram"))
    #> [[1]] -#> [[1]][[1]] -#> [1] "id_col" -#> -#> -#> [[2]] -#> [[2]][[1]] -#> [1] "value_col" -#> -#> -#> [[3]] -#> [[3]][[1]] -#> [1] "measure_col" -#> -#> -#> [[4]] -#> [[4]][[1]] -#> [1] "normal_col_low" -#> -#> -#> [[5]] -#> [[5]][[1]] -#> [1] "normal_col_high" -#> -#>
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/getSettingKeys.html b/docs/reference/getSettingKeys.html deleted file mode 100644 index 9e5f872b..00000000 --- a/docs/reference/getSettingKeys.html +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - -Get setting keys matching a pattern — getSettingKeys • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Recursive function to find all keys matching a given text pattern in a settings list

    - -
    - -
    getSettingKeys(patterns, settings, parents = NULL, matchLists = FALSE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    patterns

    List of text patterns to match with named elements in settings.

    settings

    List of settings used to generate a chart like eDISH().

    parents

    List containing the position of the parent list using recursive matches.

    matchLists

    Boolean indicating whether keys containing lists should be returned as matches.

    - -

    Value

    - -

    List of lists specifying the position of matching named elements in the format list("filters",2,"value_col"), which would correspond to settings[["filters"]][[2]][["value_col"]].

    - -

    Details

    - -

    This function loops through all named elements (or "keys") in a settings list and returns items that match patterns. If matchLists==FALSE (the default), the function iteratively looks through the named elements in nested lists using the built-in parents parameter. The function returns a array of keys for all matches using a list of lists. Each key is defines the position of a matching key using an unnamed list. For example, list("filters",2,"value_col") would correspond to settings[["filters"]][[2]][["value_col"]].

    - - -

    Examples

    -
    testSettings<-generateSettings(standard="AdAM") - -# returns list of all matching values -safetyGraphics:::getSettingKeys(patterns=c("_col"), - settings=testSettings)
    #> [[1]] -#> [[1]][[1]] -#> [1] "id_col" -#> -#> -#> [[2]] -#> [[2]][[1]] -#> [1] "value_col" -#> -#> -#> [[3]] -#> [[3]][[1]] -#> [1] "measure_col" -#> -#> -#> [[4]] -#> [[4]][[1]] -#> [1] "normal_col_low" -#> -#> -#> [[5]] -#> [[5]][[1]] -#> [1] "normal_col_high" -#> -#> -#> [[6]] -#> [[6]][[1]] -#> [1] "studyday_col" -#> -#> -#> [[7]] -#> [[7]][[1]] -#> [1] "visit_col" -#> -#> -#> [[8]] -#> [[8]][[1]] -#> [1] "visitn_col" -#> -#> -#> [[9]] -#> [[9]][[1]] -#> [1] "group_cols" -#> -#> -#> [[10]] -#> [[10]][[1]] -#> [1] "baseline" -#> -#> [[10]][[2]] -#> [1] "value_col" -#> -#> -#> [[11]] -#> [[11]][[1]] -#> [1] "analysisFlag" -#> -#> [[11]][[2]] -#> [1] "value_col" -#> -#> -#> [[12]] -#> [[12]][[1]] -#> [1] "unit_col" -#> -#>
    -#finds the matching nested setting -safetyGraphics:::getSettingKeys(patterns=c("ALP"), - settings=testSettings)
    #> [[1]] -#> [[1]][[1]] -#> [1] "measure_values" -#> -#> [[1]][[2]] -#> [1] "ALP" -#> -#>
    -#returns an empty list, since the only matching item is a list -safetyGraphics:::getSettingKeys(patterns=c("measure_values"), - settings=testSettings)
    #> list()
    -#finds the matching key associated with a list -safetyGraphics:::getSettingKeys(patterns=c("measure_values"), - settings=testSettings, - matchLists=TRUE)
    #> [[1]] -#> [[1]][[1]] -#> [1] "measure_values" -#> -#>
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/getSettingValue.html b/docs/reference/getSettingValue.html deleted file mode 100644 index 8fa564cd..00000000 --- a/docs/reference/getSettingValue.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - -Retrieve the value for a given named parameter — getSettingValue • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Returns the value for a named parameter (key) in a list settings

    - -
    - -
    getSettingValue(key, settings)
    - -

    Arguments

    - - - - - - - - - - -
    key

    a list (like those provided by getSettingKeys()) defining the position of parameter in the settings object.

    settings

    The settings list used to generate a chart like eDISH()

    - -

    Value

    - -

    the value of the key/settings combo

    - - -

    Examples

    -
    safetyGraphics:::getSettingValue(list("a","b"),list(a=list(b="myValue"))) #returns "myValue"
    #> [1] "myValue"
    -testSettings<-generateSettings(standard="AdAM") -safetyGraphics:::getSettingValue(list("id_col"),testSettings)
    #> [1] "USUBJID"
    safetyGraphics:::getSettingValue(list("measure_values","ALP"),testSettings)
    #> [1] "Alkaline Phosphatase (U/L)"
    safetyGraphics:::getSettingValue(list("NotASetting"),testSettings) #returns NULL
    #> NULL
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/getSettingsMetadata.html b/docs/reference/getSettingsMetadata.html deleted file mode 100644 index c1cf68db..00000000 --- a/docs/reference/getSettingsMetadata.html +++ /dev/null @@ -1,528 +0,0 @@ - - - - - - - - -Get metadata about chart settings — getSettingsMetadata • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Retrieve specified metadata about chart settings from the data/settingsMetadata.Rda file.

    - -
    - -
    getSettingsMetadata(charts = NULL, text_keys = NULL, cols = NULL,
    -  filter_expr = NULL, add_standards = TRUE,
    -  metadata = safetyGraphics::settingsMetadata)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    charts

    optional vector of chart names used to filter the metadata. Exact matches only (case-insensitive). All rows returned by default.

    text_keys

    optional vector of keys used to filter the metadata. Partial matches for any of the strings are returned (case-insensitive). All rows returned by default.

    cols

    optional vector of columns to return from the metadata. All columns returned by default.

    filter_expr

    optional filter expression used to subset the data.

    add_standards

    should data standard info stored in standardsMetadata be included

    metadata

    metadata data frame to be queried

    - -

    Value

    - -

    dataframe with the requested metadata or single metadata value

    - - -

    Examples

    -
    safetyGraphics:::getSettingsMetadata()
    #> text_key label -#> 1 id_col ID column -#> 2 value_col Value column -#> 3 measure_col Measure column -#> 4 measure_values--ALT Alanine Aminotransferase value -#> 5 measure_values--AST Aspartate Aminotransferase value -#> 6 measure_values--TB Total Bilirubin value -#> 7 measure_values--ALP Alkaline Phosphatase value -#> 8 normal_col_low Lower Limit of Normal column -#> 9 normal_col_high Upper Limit of Normal column -#> 10 studyday_col Study Day column -#> 11 visit_col Visit column -#> 12 visitn_col Visit Number column -#> 13 filters Filters columns -#> 14 group_cols Group columns -#> 15 baseline--value_col Baseline column -#> 16 baseline--values Baseline values -#> 17 analysisFlag--value_col Analysis Flag column -#> 18 analysisFlag--values Analysis Flag values -#> 19 x_options X axis options -#> 20 y_options Y axis options -#> 21 visit_window Default Visit Window in Days -#> 22 r_ratio_filter Show R Ratio Filter? -#> 23 r_ratio_cut Default R Ratio Cut -#> 24 showTitle Show Chart Title? -#> 25 warningText Warning text -#> 26 unit_col Unit column -#> 27 start_value Measure start value -#> 28 details Details columns -#> 29 missingValues Missing values -#> 30 visits_without_data Visits without data -#> 31 unscheduled_visits Unscheduled visits -#> 32 unscheduled_visit_pattern Unscheduled visit pattern -#> 33 calculate_palt Calculate PALT? -#> description -#> 1 Unique subject identifier variable name. -#> 2 Lab result variable name. -#> 3 Lab measure variable name -#> 4 Value used for Alanine Aminotransferase in the specified measure column -#> 5 Value used for Aspartate Aminotransferase in the specified measure column -#> 6 Value used for Total Bilirubin in the specified measure column -#> 7 Value used for Alkaline Phosphatase in the specified measure column -#> 8 Lower limit of normal variable name -#> 9 Upper limit of normal variable name -#> 10 Visit day variable name -#> 11 Visit variable name -#> 12 Visit number variable name -#> 13 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. -#> 14 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. -#> 15 An optional list defining which column represent the baseline visit(s) of the study. -#> 16 An optional list defining which values (one or more) represent the baseline visit(s) of the study. -#> 17 An optional list defining which column should be used in eDish and mDish analyses. -#> 18 An optional list defining which values should be used in eDish and mDish analyses. -#> 19 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. -#> 20 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. -#> 21 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. -#> 22 Specifies whether the R Ratio filter should be shown. R ratio is defined as: (ALT value/ULN for ALT) / (ALP value/ULN for ALP). -#> 23 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. -#> 24 Specifies whether the title should be drawn above the controls. -#> 25 Informational text to be displayed near the top of the controls (beneath the title, if any). No warning is displayed if warningText = ''. -#> 26 Unit of measure variable name -#> 27 Value of variable defined in measure_col to be rendered in the histogram when the widget loads -#> 28 An optional list of specifications for details listing. Each column to be added to details listing is a nested, named list (containing the variable name: "value_col" and associated label: "label") within the larger list. -#> 29 Values defining a missing value in the selected 'value' column -#> 30 Controls display of visits without data for the current measure -#> 31 Controls display of unscheduled visits -#> 32 A regular expression that identifies unscheduled visits -#> 33 Specifies whether PALT should be shown in the participant details. PALT shows promise in predicting the percentage hepatocyte loss on the basis of the maximum value and the AUC of serum ALT observed during a DILI event. -#> setting_type setting_required column_mapping column_type field_mapping -#> 1 character TRUE TRUE character FALSE -#> 2 character TRUE TRUE numeric FALSE -#> 3 character TRUE TRUE character FALSE -#> 4 character TRUE FALSE <NA> TRUE -#> 5 character TRUE FALSE <NA> TRUE -#> 6 character TRUE FALSE <NA> TRUE -#> 7 character TRUE FALSE <NA> TRUE -#> 8 character TRUE TRUE numeric FALSE -#> 9 character TRUE TRUE numeric FALSE -#> 10 character TRUE TRUE numeric FALSE -#> 11 character TRUE TRUE character FALSE -#> 12 character TRUE TRUE numeric FALSE -#> 13 vector FALSE TRUE <NA> FALSE -#> 14 vector FALSE TRUE <NA> FALSE -#> 15 character FALSE TRUE <NA> FALSE -#> 16 vector FALSE FALSE <NA> TRUE -#> 17 character FALSE TRUE <NA> FALSE -#> 18 vector FALSE FALSE <NA> TRUE -#> 19 vector FALSE FALSE <NA> FALSE -#> 20 vector FALSE FALSE <NA> FALSE -#> 21 numeric FALSE FALSE <NA> FALSE -#> 22 logical FALSE FALSE <NA> FALSE -#> 23 numeric FALSE FALSE <NA> FALSE -#> 24 logical FALSE FALSE <NA> FALSE -#> 25 character FALSE FALSE <NA> FALSE -#> 26 character FALSE TRUE character FALSE -#> 27 character FALSE FALSE <NA> TRUE -#> 28 vector FALSE TRUE <NA> FALSE -#> 29 vector FALSE FALSE <NA> FALSE -#> 30 logical FALSE FALSE <NA> FALSE -#> 31 logical FALSE FALSE <NA> FALSE -#> 32 character FALSE FALSE <NA> FALSE -#> 33 logical FALSE FALSE <NA> FALSE -#> field_column_key setting_cat -#> 1 data -#> 2 data -#> 3 data -#> 4 measure_col data -#> 5 measure_col data -#> 6 measure_col data -#> 7 measure_col data -#> 8 data -#> 9 data -#> 10 data -#> 11 data -#> 12 data -#> 13 data -#> 14 data -#> 15 data -#> 16 baseline--value_col data -#> 17 data -#> 18 analysisFlag--value_col data -#> 19 measure -#> 20 measure -#> 21 appearance -#> 22 appearance -#> 23 appearance -#> 24 appearance -#> 25 appearance -#> 26 data -#> 27 measure_col data -#> 28 data -#> 29 data -#> 30 data -#> 31 data -#> 32 data -#> 33 appearance -#> default -#> 1 NULL -#> 2 NULL -#> 3 NULL -#> 4 NULL -#> 5 NULL -#> 6 NULL -#> 7 NULL -#> 8 NULL -#> 9 NULL -#> 10 NULL -#> 11 NULL -#> 12 NULL -#> 13 NULL -#> 14 NULL -#> 15 NULL -#> 16 NULL -#> 17 NULL -#> 18 NULL -#> 19 ALT, AST, ALP -#> 20 TB, ALP -#> 21 30 -#> 22 TRUE -#> 23 0 -#> 24 TRUE -#> 25 Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures. -#> 26 NULL -#> 27 NULL -#> 28 NULL -#> 29 , NA, N/A -#> 30 FALSE -#> 31 FALSE -#> 32 /unscheduled|early termination/i -#> 33 NULL -#> chart_hepexplorer chart_safetyhistogram chart_safetyoutlierexplorer -#> 1 TRUE TRUE TRUE -#> 2 TRUE TRUE TRUE -#> 3 TRUE TRUE TRUE -#> 4 TRUE FALSE FALSE -#> 5 TRUE FALSE FALSE -#> 6 TRUE FALSE FALSE -#> 7 TRUE FALSE FALSE -#> 8 TRUE TRUE TRUE -#> 9 TRUE TRUE TRUE -#> 10 TRUE FALSE TRUE -#> 11 TRUE FALSE TRUE -#> 12 TRUE FALSE TRUE -#> 13 TRUE TRUE TRUE -#> 14 TRUE FALSE FALSE -#> 15 TRUE FALSE FALSE -#> 16 TRUE FALSE FALSE -#> 17 TRUE FALSE FALSE -#> 18 TRUE FALSE FALSE -#> 19 TRUE FALSE FALSE -#> 20 TRUE FALSE FALSE -#> 21 TRUE FALSE FALSE -#> 22 TRUE FALSE FALSE -#> 23 TRUE FALSE FALSE -#> 24 TRUE FALSE FALSE -#> 25 TRUE FALSE FALSE -#> 26 FALSE TRUE TRUE -#> 27 FALSE TRUE TRUE -#> 28 TRUE TRUE TRUE -#> 29 FALSE TRUE FALSE -#> 30 FALSE FALSE TRUE -#> 31 FALSE FALSE TRUE -#> 32 FALSE FALSE TRUE -#> 33 TRUE FALSE FALSE -#> chart_safetyshiftplot chart_safetyresultsovertime -#> 1 TRUE TRUE -#> 2 TRUE TRUE -#> 3 TRUE TRUE -#> 4 FALSE FALSE -#> 5 FALSE FALSE -#> 6 FALSE FALSE -#> 7 FALSE FALSE -#> 8 FALSE TRUE -#> 9 FALSE TRUE -#> 10 FALSE FALSE -#> 11 TRUE TRUE -#> 12 FALSE TRUE -#> 13 TRUE TRUE -#> 14 FALSE TRUE -#> 15 FALSE FALSE -#> 16 FALSE FALSE -#> 17 FALSE FALSE -#> 18 FALSE FALSE -#> 19 FALSE FALSE -#> 20 FALSE FALSE -#> 21 FALSE FALSE -#> 22 FALSE FALSE -#> 23 FALSE FALSE -#> 24 FALSE FALSE -#> 25 FALSE FALSE -#> 26 TRUE TRUE -#> 27 TRUE TRUE -#> 28 FALSE FALSE -#> 29 FALSE FALSE -#> 30 FALSE TRUE -#> 31 FALSE TRUE -#> 32 FALSE TRUE -#> 33 FALSE FALSE -#> chart_paneledoutlierexplorer chart_safetydeltadelta -#> 1 TRUE TRUE -#> 2 TRUE TRUE -#> 3 TRUE TRUE -#> 4 FALSE FALSE -#> 5 FALSE FALSE -#> 6 FALSE FALSE -#> 7 FALSE FALSE -#> 8 TRUE FALSE -#> 9 TRUE FALSE -#> 10 TRUE FALSE -#> 11 TRUE TRUE -#> 12 TRUE TRUE -#> 13 TRUE TRUE -#> 14 FALSE FALSE -#> 15 FALSE FALSE -#> 16 FALSE FALSE -#> 17 FALSE FALSE -#> 18 FALSE FALSE -#> 19 FALSE FALSE -#> 20 FALSE FALSE -#> 21 FALSE FALSE -#> 22 FALSE FALSE -#> 23 FALSE FALSE -#> 24 FALSE FALSE -#> 25 FALSE FALSE -#> 26 TRUE FALSE -#> 27 FALSE FALSE -#> 28 FALSE TRUE -#> 29 FALSE FALSE -#> 30 TRUE FALSE -#> 31 TRUE FALSE -#> 32 TRUE FALSE -#> 33 FALSE FALSE -#> sdtm adam -#> 1 USUBJID USUBJID -#> 2 STRESN AVAL -#> 3 TEST PARAM -#> 4 Aminotransferase, alanine (ALT) Alanine Aminotransferase (U/L) -#> 5 Aminotransferase, aspartate (AST) Aspartate Aminotransferase (U/L) -#> 6 Total Bilirubin Bilirubin (umol/L) -#> 7 Alkaline phosphatase (ALP) Alkaline Phosphatase (U/L) -#> 8 STNRLO A1LO -#> 9 STNRHI A1HI -#> 10 DY ADY -#> 11 VISIT VISIT -#> 12 VISITNUM VISITNUM -#> 13 -#> 14 -#> 15 -#> 16 -#> 17 -#> 18 -#> 19 -#> 20 -#> 21 -#> 22 -#> 23 -#> 24 -#> 25 -#> 26 STRESU -#> 27 -#> 28 -#> 29 -#> 30 -#> 31 -#> 32 -#> 33 <NA> <NA>
    # Returns a full copy of settingsMetadata.Rda - -safetyGraphics:::getSettingsMetadata(text_keys=c("id_col"))
    #> text_key label description setting_type -#> 1 id_col ID column Unique subject identifier variable name. character -#> setting_required column_mapping column_type field_mapping field_column_key -#> 1 TRUE TRUE character FALSE -#> setting_cat default chart_hepexplorer chart_safetyhistogram -#> 1 data NULL TRUE TRUE -#> chart_safetyoutlierexplorer chart_safetyshiftplot chart_safetyresultsovertime -#> 1 TRUE TRUE TRUE -#> chart_paneledoutlierexplorer chart_safetydeltadelta sdtm adam -#> 1 TRUE TRUE USUBJID USUBJID
    # returns a dataframe with a single row with metadata for the id_col setting - -safetyGraphics:::getSettingsMetadata(text_keys=c("id_col"), cols=c("label"))
    #> [1] "ID column"
    # returns the character value for the specified row. - -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/hasColumn.html b/docs/reference/hasColumn.html deleted file mode 100644 index 714b6cc7..00000000 --- a/docs/reference/hasColumn.html +++ /dev/null @@ -1,128 +0,0 @@ - -Check whether a column is found in a data set — hasColumn • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Checks whether a specified column is found in a specified data set

    -
    - -
    -
    hasColumn(columnName, data)
    -
    - -
    -

    Arguments

    -
    columnName
    -

    The column to look for.

    -
    data
    -

    the data.frame to search.

    -
    -
    -

    Value

    -

    logical scalar. TRUE if the column is found. FALSE otherwise

    -
    - -
    -

    Examples

    -
    safetyGraphics:::hasColumn(columnName="PARAM",data=safetyData::adam_adlbc) #TRUE
    -#> [1] TRUE
    -safetyGraphics:::hasColumn(columnName="Not_a_column",data=safetyData::adam_adlbc) #FALSE
    -#> [1] FALSE
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/hasField.html b/docs/reference/hasField.html deleted file mode 100644 index 71303d31..00000000 --- a/docs/reference/hasField.html +++ /dev/null @@ -1,141 +0,0 @@ - -Check whether a specified field value is found in a data set — hasField • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    This checks whether a specific value is found in a specified column in a specified data set

    -
    - -
    -
    hasField(fieldValue, columnName, data)
    -
    - -
    -

    Arguments

    -
    fieldValue
    -

    A value to check for.

    -
    columnName
    -

    The column to check.

    -
    data
    -

    the data.frame to search.

    -
    -
    -

    Value

    -

    logical scalar. TRUE if field_value is found. FALSE otherwise

    -
    - -
    -

    Examples

    -
    #TRUE
    -safetyGraphics:::hasField(
    - fieldValue="Bilirubin (umol/L)",
    - columnName="PARAM",
    - data=safetyData::adam_adlbc
    -)
    -#> [1] TRUE
    -
    -#FALSE
    -safetyGraphics:::hasField(
    - fieldValue="Not_a_real_value",
    - columnName="",
    - data=safetyData::adam_adlbc
    -)
    -#> [1] FALSE
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/homeTab.html b/docs/reference/homeTab.html deleted file mode 100644 index 2beb9445..00000000 --- a/docs/reference/homeTab.html +++ /dev/null @@ -1,117 +0,0 @@ - -Server for the filter module in datamods::filter_data_ui — homeTab • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for the filter module in datamods::filter_data_ui

    -
    - -
    -
    homeTab(input, output, session)
    -
    - -
    -

    Arguments

    -
    input
    -

    mod input

    -
    output
    -

    mod output

    -
    session
    -

    mod session

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/homeTabUI.html b/docs/reference/homeTabUI.html deleted file mode 100644 index 808bd9c4..00000000 --- a/docs/reference/homeTabUI.html +++ /dev/null @@ -1,113 +0,0 @@ - -UI for the home module — homeTabUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for the home module

    -
    - -
    -
    homeTabUI(id)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index 40a3985d..00000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,290 +0,0 @@ - -Function reference • safetyGraphics - - -
    -
    - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    Main Shiny App Functions

    -

    -
    -

    safetyGraphicsApp()

    -

    Run the core safetyGraphics App

    -

    safetyGraphicsInit()

    -

    App to select charts, load data and then initialize the core safetyGraphics app

    -

    Shiny Modules

    -

    Reusable Shiny Modules

    -
    -

    safetyGraphicsServer()

    -

    Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

    -

    safetyGraphicsUI()

    -

    UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

    -

    chartsTab()

    -

    Server for chart module, designed to be re-used for each chart generated.

    -

    chartsTabUI()

    -

    UI for chart module, designed to be re-used for each chart generated.

    -

    filterTab()

    -

    Server for the filter module in datamods::filter_data_ui

    -

    filterTabUI()

    -

    UI for the filter module in datamods::filter_data_ui

    -

    homeTab()

    -

    Server for the filter module in datamods::filter_data_ui

    -

    homeTabUI()

    -

    UI for the home module

    -

    loadCharts()

    -

    Server for the chart loading module used in safetyGraphicsInit()

    -

    loadChartsUI()

    -

    UI for the chart loading module used in safetyGraphicsInit()

    -

    loadData()

    -

    Server for the data loading module used in safetyGraphicsInit()

    -

    loadDataUI()

    -

    UI for the data loading module used in safetyGraphicsInit()

    -

    mappingTab()

    -

    Server for mapping tab covering of all data domains

    -

    mappingTabUI()

    -

    UI for mapping tab covering of all data domains

    -

    mappingDomain()

    -

    Server that facilitates the mapping of a full data domain

    -

    mappingDomainUI()

    -

    UI that facilitates the mapping of a full data domain

    -

    mappingColumn()

    -

    Server that facilitates the mapping of a column data (and any associated fields)

    -

    mappingColumnUI()

    -

    UI that facilitates the mapping of a column data (and any associated fields)

    -

    mappingSelect()

    -

    Server that facilitates the mapping of a single data element (column or field) with a simple select UI

    -

    mappingSelectUI()

    -

    UI that facilitates the mapping of a single data element (column or field) with a simple select UI

    -

    settingsTab()

    -

    Server for the setting page

    -

    settingsTabUI()

    -

    UI for the settings tab

    -

    settingsCharts()

    -

    Server for settings tab showing details for the charts loaded in the app

    -

    settingsChartsUI()

    -

    UI for settings tab showing details for the charts loaded in the app

    -

    settingsData()

    -

    Server for settings tab showing current data

    -

    settingsDataUI()

    -

    UI for settings tab showing current data

    -

    settingsMapping()

    -

    Server for settings tab showing current mapping

    -

    settingsMappingUI()

    -

    UI for settings tab showing current mapping

    -

    settingsCode()

    -

    Server for settings tab providing code to re-start the app with current data/settings

    -

    settingsCodeUI()

    -

    UI for settings tab providing code to re-start the app with current data/settings

    -

    Helper Functions

    -

    Utility functions used in the apps

    -
    -

    app_startup()

    -

    Startup code for shiny app

    -

    chartsNav()

    -

    Adds a navbar tab that initializes the Chart Module UI

    -

    detectStandard()

    -

    Detect the data standard used for a data set

    -

    evaluateStandard()

    -

    Evaluate a data set against a data standard

    -

    filterTabChecks()

    -

    Checks for whether the current data and settings support a filter tab

    -

    generateMappingList()

    -

    Convert mapping data.frame to a list

    -

    makeChartConfig()

    -

    Make Chart Config

    -

    makeChartExport()

    -

    Make Chart Export

    -

    makeChartParams()

    -

    Make Chart Parameters

    -

    makeChartSummary()

    -

    html chart summary

    -

    makeMapping()

    -

    Create data mapping based on data standards and user input

    -

    makeMeta()

    -

    Create a metadata object table for a set of charts

    -

    prepareChart()

    -

    Prepare a chart object for safetyGraphics

    - - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/loadCharts.html b/docs/reference/loadCharts.html deleted file mode 100644 index 56ed5e02..00000000 --- a/docs/reference/loadCharts.html +++ /dev/null @@ -1,119 +0,0 @@ - -Server for the chart loading module used in safetyGraphicsInit() — loadCharts • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for the chart loading module used in safetyGraphicsInit()

    -
    - -
    -
    loadCharts(input, output, session, charts = makeChartConfig())
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    charts
    -

    list containing chart specifications like those returned by makeChartConfig.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/loadChartsUI.html b/docs/reference/loadChartsUI.html deleted file mode 100644 index 389688a6..00000000 --- a/docs/reference/loadChartsUI.html +++ /dev/null @@ -1,115 +0,0 @@ - -UI for the chart loading module used in safetyGraphicsInit() — loadChartsUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for the chart loading module used in safetyGraphicsInit()

    -
    - -
    -
    loadChartsUI(id, charts = makeChartConfig())
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    charts
    -

    list containing chart specifications like those returned by makeChartConfig.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/loadData.html b/docs/reference/loadData.html deleted file mode 100644 index 7b091f4a..00000000 --- a/docs/reference/loadData.html +++ /dev/null @@ -1,119 +0,0 @@ - -Server for the data loading module used in safetyGraphicsInit() — loadData • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for the data loading module used in safetyGraphicsInit()

    -
    - -
    -
    loadData(input, output, session, domain)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    domain
    -

    data domain to be loaded

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/loadDataUI.html b/docs/reference/loadDataUI.html deleted file mode 100644 index 460107fe..00000000 --- a/docs/reference/loadDataUI.html +++ /dev/null @@ -1,115 +0,0 @@ - -UI for the data loading module used in safetyGraphicsInit() — loadDataUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for the data loading module used in safetyGraphicsInit()

    -
    - -
    -
    loadDataUI(id, domain = NULL)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    domain
    -

    character vector with domains to be loaded

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/makeChartConfig.html b/docs/reference/makeChartConfig.html deleted file mode 100644 index 4a597c81..00000000 --- a/docs/reference/makeChartConfig.html +++ /dev/null @@ -1,139 +0,0 @@ - -Make Chart Config — makeChartConfig • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Converts YAML chart configuration files to an R list and binds workflow functions. See the vignette about creating custom charts for more details.

    -
    - -
    -
    makeChartConfig(
    -  dirs,
    -  packages = "safetyCharts",
    -  packageLocation = "config",
    -  sourceFiles = FALSE
    -)
    -
    - -
    -

    Arguments

    -
    dirs
    -

    path to one or more directories containing yaml config files (relative to working directory)

    -
    packages
    -

    installed packages names containing yaml config files in the /inst/packageLocation folder

    -
    packageLocation
    -

    inst folder where yaml config files (and possibly R functions referenced in yaml workflow) are located in packages

    -
    sourceFiles
    -

    boolean indicating whether to source all R files found in dirs.

    -
    -
    -

    Value

    -

    returns a named list of charts derived from YAML files. Each element of the list contains information about a single chart, and has the following parameters:

    • "env" Environment for the chart. Must be set to "safetyGraphics" or the chart is dropped.

    • -
    • "name" Name of the chart. Also the name of the element in the list - e.g. charts$aeExplorer$name is "aeExplorer"

    • -
    • "label" Short description of the chart

    • -
    • "type" Type of chart; options are: 'htmlwidget', 'module', 'plot', 'table', 'html' or 'plotly'.

    • -
    • "domain" Data domain. Should correspond to one or more domains in meta

    • -
    • "package" Primary package (if any). Other packages can be loaded directly in workflow functions.

    • -
    • "order" Integer order in which to display the chart. If order is a negative number, the chart is dropped.

    • -
    • "export" Logical flag indicating whether the chart can be exported to an html report. True by default, except for when type is module.

    • -
    • "path" Path to YAML file

    • -
    • "links" Named list of link names/urls to be shown in the chart header.

    • -
    • "workflow" List of functions names used to render chart. See vignette for details.

    • -
    • "functions" List of functions for use in chart renderering. These functions must be located in the global environment or package field of the YAML config. Function names must include either the name or workflow fields of the YAML config.

    • -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/makeChartExport.html b/docs/reference/makeChartExport.html deleted file mode 100644 index ac7c4113..00000000 --- a/docs/reference/makeChartExport.html +++ /dev/null @@ -1,119 +0,0 @@ - -Make Chart Export — makeChartExport • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Creates R code that allows chart to be exported

    -
    - -
    -
    makeChartExport(chart, mapping)
    -
    - -
    -

    Arguments

    -
    chart
    -

    chart object like the one generated by makeChartConfig().

    -
    mapping
    -

    mapping object like the one generated by makeMapping().

    -
    -
    -

    Value

    -

    returns a character vector that can be saved as R code.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/makeChartParams.html b/docs/reference/makeChartParams.html deleted file mode 100644 index 048d24cb..00000000 --- a/docs/reference/makeChartParams.html +++ /dev/null @@ -1,117 +0,0 @@ - -Make Chart Parameters — makeChartParams • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Updates raw data and mapping for use with a specific chart

    -
    - -
    -
    makeChartParams(data, chart, mapping)
    -
    - -
    -

    Arguments

    -
    data
    -

    list of domain-level data

    -
    chart
    -

    list containing chart specifications

    -
    mapping
    -

    data frame with current mapping

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/makeChartSummary.html b/docs/reference/makeChartSummary.html deleted file mode 100644 index 501e15ff..00000000 --- a/docs/reference/makeChartSummary.html +++ /dev/null @@ -1,117 +0,0 @@ - -html chart summary — makeChartSummary • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    makes a nicely formatted html summary for a chart object

    -
    - -
    -
    makeChartSummary(chart, showLinks = TRUE, class = "chart-header")
    -
    - -
    -

    Arguments

    -
    chart
    -

    list containing chart specifications

    -
    showLinks
    -

    boolean indicating whether to include links

    -
    class
    -

    character to include as class

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/makeMapping.html b/docs/reference/makeMapping.html deleted file mode 100644 index f261cbd4..00000000 --- a/docs/reference/makeMapping.html +++ /dev/null @@ -1,124 +0,0 @@ - -Create data mapping based on data standards and user input — makeMapping • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Create data mapping based on data standards and user input

    -
    - -
    -
    makeMapping(domainData, meta, autoMapping, customMapping)
    -
    - -
    -

    Arguments

    -
    domainData
    -

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    -
    meta
    -

    data frame containing the metadata for use in the app.

    -
    autoMapping
    -

    boolean indicating whether the app should use safetyGraphics::detectStandard() to detect data standards and automatically generate mappings for the data provided. Values specified in the customMapping parameter overwrite auto-generated mappings when both are found. Defaults to true.

    -
    customMapping
    -

    optional list specifying initial mapping values within each data mapping (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    -
    -
    -

    Value

    -

    List containing data standard information and mapping

    • "mapping" Initial Data Mapping

    • -
    • "standards" List of domain level data standards (or NULL if autoMapping is false)

    • -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/makeMeta.html b/docs/reference/makeMeta.html deleted file mode 100644 index d7e91daa..00000000 --- a/docs/reference/makeMeta.html +++ /dev/null @@ -1,156 +0,0 @@ - -Create a metadata object table for a set of charts — makeMeta • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Generates metadata object for a list of charts. makeMeta() looks for metadata in 3 locations for each chart object:

    • Domain-level metadata saved as meta_chart$name in the chart$package namespace

    • -
    • Chart-specific metadata saved as meta_chart$domain in the chart$package namespace

    • -
    • Chart-specific metadata saved directly to the chart object as chart$meta -After checking all charts, all metadata files are stacked in to a single dataframe and returned. If duplicate metadata rows (domain + text_key) are found, an error is thrown.

    • -
    - -
    -
    makeMeta(charts)
    -
    - -
    -

    Arguments

    -
    charts
    -

    list of safetyGraphics chart objects for which to create metadata

    -
    -
    -

    Value

    -

    tibble of metadata with the following columns:

    domain
    -

    Data domain

    - -
    text_key
    -

    Text key indicating the setting name. '--' delimiter indicates a field level data mapping

    - -
    col_key
    -

    Key for the column mapping

    - -
    field_key
    -

    Key for the field mapping (if any)

    - -
    type
    -

    type of mapping - "field" or "column"

    - -
    label
    -

    Label

    - -
    description
    -

    Description

    - -
    multiple
    -

    Mapping supports multiple columns/fields

    - -
    standard_adam
    -

    Default values for the ADaM data standard

    - -
    standard_sdtm
    -

    Default values for the SDTM data standard

    - - -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingColumn.html b/docs/reference/mappingColumn.html deleted file mode 100644 index 96afa46e..00000000 --- a/docs/reference/mappingColumn.html +++ /dev/null @@ -1,125 +0,0 @@ - -Server that facilitates the mapping of a column data (and any associated fields) — mappingColumn • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server that facilitates the mapping of a column data (and any associated fields)

    -
    - -
    -
    mappingColumn(input, output, session, meta, data)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    meta
    -

    metadata data frame for the object

    -
    data
    -

    current data file for the domain

    -
    -
    -

    Value

    -

    A reactive data.frame providing the current value for text_key associated with the selected column

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingColumnUI.html b/docs/reference/mappingColumnUI.html deleted file mode 100644 index 068b7431..00000000 --- a/docs/reference/mappingColumnUI.html +++ /dev/null @@ -1,119 +0,0 @@ - -UI that facilitates the mapping of a column data (and any associated fields) — mappingColumnUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI that facilitates the mapping of a column data (and any associated fields)

    -
    - -
    -
    mappingColumnUI(id, meta, data, mapping = NULL)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    meta
    -

    metadata for the column (and related fields)

    -
    data
    -

    current data file for the domain

    -
    mapping
    -

    current data mapping for the column (and related fields)

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingDomain.html b/docs/reference/mappingDomain.html deleted file mode 100644 index 0de30f59..00000000 --- a/docs/reference/mappingDomain.html +++ /dev/null @@ -1,125 +0,0 @@ - -Server that facilitates the mapping of a full data domain — mappingDomain • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server that facilitates the mapping of a full data domain

    -
    - -
    -
    mappingDomain(input, output, session, meta, data)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    meta
    -

    metadata for the domain

    -
    data
    -

    clinical data for the domain

    -
    -
    -

    Value

    -

    A reactive data frame containing the mapping for the domain

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingDomainUI.html b/docs/reference/mappingDomainUI.html deleted file mode 100644 index bcd2fe14..00000000 --- a/docs/reference/mappingDomainUI.html +++ /dev/null @@ -1,119 +0,0 @@ - -UI that facilitates the mapping of a full data domain — mappingDomainUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI that facilitates the mapping of a full data domain

    -
    - -
    -
    mappingDomainUI(id, meta, data, mapping = NULL)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    meta
    -

    metadata for the domain

    -
    data
    -

    data file for the domain

    -
    mapping
    -

    current data mapping

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingSelect.html b/docs/reference/mappingSelect.html deleted file mode 100644 index 3d7efbb1..00000000 --- a/docs/reference/mappingSelect.html +++ /dev/null @@ -1,121 +0,0 @@ - -Server that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelect • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server that facilitates the mapping of a single data element (column or field) with a simple select UI

    -
    - -
    -
    mappingSelect(input, output, session)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    -
    -

    Value

    -

    A reactive containing the selected column

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingSelectUI.html b/docs/reference/mappingSelectUI.html deleted file mode 100644 index fe6d3325..00000000 --- a/docs/reference/mappingSelectUI.html +++ /dev/null @@ -1,123 +0,0 @@ - -UI that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelectUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI that facilitates the mapping of a single data element (column or field) with a simple select UI

    -
    - -
    -
    mappingSelectUI(id, label, choices = NULL, default = NULL)
    -
    - -
    -

    Arguments

    -
    id
    -

    unique id for the UI

    -
    label
    -

    label associated with the control

    -
    choices
    -

    a list of options for the control

    -
    default
    -

    default value for the control

    -
    -
    -

    Value

    -

    returns the selected value wrapped in a reactive().

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingTab.html b/docs/reference/mappingTab.html deleted file mode 100644 index d3f852cd..00000000 --- a/docs/reference/mappingTab.html +++ /dev/null @@ -1,125 +0,0 @@ - -Server for mapping tab covering of all data domains — mappingTab • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for mapping tab covering of all data domains

    -
    - -
    -
    mappingTab(input, output, session, meta, domainData)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    meta
    -

    metadata for all domains

    -
    domainData
    -

    clinical data for all domains

    -
    -
    -

    Value

    -

    list of mappings for all domains

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/mappingTabUI.html b/docs/reference/mappingTabUI.html deleted file mode 100644 index 0267550a..00000000 --- a/docs/reference/mappingTabUI.html +++ /dev/null @@ -1,121 +0,0 @@ - -UI for mapping tab covering of all data domains — mappingTabUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for mapping tab covering of all data domains

    -
    - -
    -
    mappingTabUI(id, meta, domainData, mappings = NULL, standards = NULL)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    meta
    -

    metadata for all domains

    -
    domainData
    -

    list of data files for each domain

    -
    mappings
    -

    optional data frame containing stacked mappings for all domains

    -
    standards
    -

    optional list of data standards like the ones generated by detectStandard()

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/meta.html b/docs/reference/meta.html deleted file mode 100644 index 083f97ae..00000000 --- a/docs/reference/meta.html +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - -Metadata data frame containing information about the data mapping used to configure safetyGraphics charts. One record per unique data mapping — meta • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    -

    Metadata data frame containing information about the data mapping used to configure safetyGraphics charts. One record per unique data mapping

    -
    - -
    meta
    - - -

    Format

    - -

    A data frame with 31 rows and 7 columns

    -
    domain

    Data domain

    -
    text_key

    Text key indicating the setting name. '--' delimiter indicates a field level data mapping

    -
    col_key

    Key for the column mapping

    -
    field_key

    Key for the field mapping (if any)

    -
    type

    type of mapping - "field" or "column"

    -
    label

    Label

    -
    description

    Description

    -
    multiple

    Mapping supports multiple columns/fields

    -
    standard_adam

    Default values for the ADaM data standard

    -
    standard_sdtm

    Default values for the SDTM data standard

    - -
    - -

    Source

    - -

    Created for this package

    - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.6.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html deleted file mode 100644 index 7efcc085..00000000 --- a/docs/reference/pipe.html +++ /dev/null @@ -1,108 +0,0 @@ - -Pipe operator — %>% • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    See magrittr::%>% for details.

    -
    - -
    -
    lhs %>% rhs
    -
    - - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/prepareChart.html b/docs/reference/prepareChart.html deleted file mode 100644 index 4048c970..00000000 --- a/docs/reference/prepareChart.html +++ /dev/null @@ -1,117 +0,0 @@ - -Prepare a chart object for safetyGraphics — prepareChart • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Sets default values and binds needed functions to a chart object based on chart type.

    -
    - -
    -
    prepareChart(chart)
    -
    - -
    -

    Arguments

    -
    chart
    -

    chart object like the one generated by makeChartConfig().

    -
    -
    -

    Value

    -

    returns the chart object with a new functions object added.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/removeCharts.html b/docs/reference/removeCharts.html deleted file mode 100644 index aa50e7ab..00000000 --- a/docs/reference/removeCharts.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - -Remove a chart from the safetyGraphics shiny app — removeCharts • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function updates settings objects to remove chart from the safetyGraphics shiny app

    - -
    - -
    removeCharts(charts, settingsLocation = getwd())
    - -

    Arguments

    - - - - - - - - - - -
    charts

    Name of the chart(s) to remove - one word, all lower case

    settingsLocation

    path where the custom settings will be loaded/saved. If metadata is not found in that location, it will be read from the package (e.g. safetyGraphics::settingsMetadata), and then written to the specified location once the chart has been removed

    - -

    Details

    - -

    This function makes it easy for remove a chart from the safetyGraphics shiny app by making updates to the underlying metadata used by the package.

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/removeSettings.html b/docs/reference/removeSettings.html deleted file mode 100644 index 35695b57..00000000 --- a/docs/reference/removeSettings.html +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - -Remove a setting from the safetyGraphics shiny app — removeSettings • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function updates settings objects to remove a setting parameter from the safetyGraphics shiny app

    - -
    - -
    removeSettings(text_keys, settingsLocation = getwd())
    - -

    Arguments

    - - - - - - - - - - -
    text_keys

    Text keys indicating the setting names to be removed.

    settingsLocation

    path where the custom settings will be loaded/saved. If metadata is not found in that location, it will be read from the package (e.g. safetyGraphics::settingsMetadata), and then written to the specified location once the setting has been removed.

    - -

    Details

    - -

    This function makes it easy for remove a setting from the safetyGraphics shiny app by making updates to the underlying metadata used by the package.

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/safetyGraphicsApp.html b/docs/reference/safetyGraphicsApp.html deleted file mode 100644 index 55735e8f..00000000 --- a/docs/reference/safetyGraphicsApp.html +++ /dev/null @@ -1,137 +0,0 @@ - -Run the core safetyGraphics App — safetyGraphicsApp • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Run the core safetyGraphics App

    -
    - -
    -
    safetyGraphicsApp(
    -  domainData = list(labs = safetyData::adam_adlbc, aes = safetyData::adam_adae, dm =
    -    safetyData::adam_adsl),
    -  meta = NULL,
    -  charts = NULL,
    -  mapping = NULL,
    -  autoMapping = TRUE,
    -  filterDomain = "dm",
    -  chartSettingsPaths = NULL,
    -  runNow = TRUE
    -)
    -
    - -
    -

    Arguments

    -
    domainData
    -

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    -
    meta
    -

    data frame containing the metadata for use in the app. If no metadata is provided, metatdata is generated by makeMeta().

    -
    charts
    -

    list of charts in the format produced by safetyGraphics::makeChartConfig()

    -
    mapping
    -

    list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    -
    autoMapping
    -

    boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the mapping parameter overwrite automatically generated mappings when both are found. Defaults to true.

    -
    filterDomain
    -

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    -
    chartSettingsPaths
    -

    path(s) where customization functions are saved relative to your working directory. All charts can have initialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.

    -
    runNow
    -

    Should the shiny app object created be run directly? Helpful when writing functions to dispatch to shinyapps, rsconnect, or shinyproxy.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/safetyGraphicsInit.html b/docs/reference/safetyGraphicsInit.html deleted file mode 100644 index db656b9c..00000000 --- a/docs/reference/safetyGraphicsInit.html +++ /dev/null @@ -1,121 +0,0 @@ - -App to select charts, load data and then initialize the core safetyGraphics app — safetyGraphicsInit • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    App to select charts, load data and then initialize the core safetyGraphics app

    -
    - -
    -
    safetyGraphicsInit(
    -  charts = makeChartConfig(),
    -  delayTime = 1000,
    -  maxFileSize = NULL
    -)
    -
    - -
    -

    Arguments

    -
    charts
    -

    chart object

    -
    delayTime
    -

    time (in ms) between drawing app UI and starting server. Default set to 1000 (1 second), but could need to be higher on slow machine.

    -
    maxFileSize
    -

    maximum file size in MB allowed for file upload

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/safetyGraphicsServer.html b/docs/reference/safetyGraphicsServer.html deleted file mode 100644 index 04fef849..00000000 --- a/docs/reference/safetyGraphicsServer.html +++ /dev/null @@ -1,136 +0,0 @@ - -Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsServer • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    This function returns a server function suitable for use in shiny::runApp()

    -
    - -
    -
    safetyGraphicsServer(
    -  input,
    -  output,
    -  session,
    -  meta,
    -  mapping,
    -  domainData,
    -  charts,
    -  filterDomain
    -)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    meta
    -

    data frame containing the metadata for use in the app.

    -
    mapping
    -

    current mapping

    -
    domainData
    -

    named list of data.frames to be loaded in to the app.

    -
    charts
    -

    list of charts to include in the app

    -
    filterDomain
    -

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/safetyGraphicsUI.html b/docs/reference/safetyGraphicsUI.html deleted file mode 100644 index 3ad2244c..00000000 --- a/docs/reference/safetyGraphicsUI.html +++ /dev/null @@ -1,121 +0,0 @@ - -UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

    -
    - -
    -
    safetyGraphicsUI(id, meta, domainData, mapping, standards)
    -
    - -
    -

    Arguments

    -
    id
    -

    module ID

    -
    meta
    -

    data frame containing the metadata for use in the app.

    -
    domainData
    -

    named list of data.frames to be loaded in to the app.

    -
    mapping
    -

    data.frame specifying the initial values for each data mapping. If no mapping is provided, the app will attempt to generate one via detectStandard()

    -
    standards
    -

    a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard.

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/setMappingListValue.html b/docs/reference/setMappingListValue.html deleted file mode 100644 index a42e8161..00000000 --- a/docs/reference/setMappingListValue.html +++ /dev/null @@ -1,136 +0,0 @@ - -Set the value for a given named parameter — setMappingListValue • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Sets the value for a named parameter (key) to given value in a list (settings)

    -
    - -
    -
    setMappingListValue(key, value, settings, forceCreate = FALSE)
    -
    - -
    -

    Arguments

    -
    key
    -

    a list defining the position of parameter in the settings object.

    -
    value
    -

    the value to set

    -
    settings
    -

    The settings list used to generate a chart like eDISH()

    -
    forceCreate
    -

    Specifies whether the function should create a new list() when none exisits. This most commonly occurs when deeply nested objects.

    -
    -
    -

    Value

    -

    the updated settings object

    -
    - -
    -

    Examples

    -
    testSet<-list(a=list(b="myValue"))
    -safetyGraphics:::setMappingListValue(key=list("a","b"), value="notMyValue", settings=testSet) 
    -#> $a
    -#> $a$b
    -#> [1] "notMyValue"
    -#> 
    -#> 
    -#returns list(a=list(b="notMyValue")))
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/setSettingsValue.html b/docs/reference/setSettingsValue.html deleted file mode 100644 index d62099a7..00000000 --- a/docs/reference/setSettingsValue.html +++ /dev/null @@ -1,523 +0,0 @@ - - - - - - - - -Set the value for a given named parameter — setSettingsValue • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Sets the value for a named parameter (key) to given value in a list (settings)

    - -
    - -
    setSettingsValue(key, value, settings, forceCreate = FALSE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    key

    a list (like those provided by getSettingKeys()) defining the position of parameter in the settings object.

    value

    the value to set

    settings

    The settings list used to generate a chart like eDISH()

    forceCreate

    Specifies whether the function should create a new list() when none exisits. This most commonly occurs when deeply nested objects.

    - -

    Value

    - -

    the updated settings object

    - - -

    Examples

    -
    testSet<-list(a=list(b="myValue")) -safetyGraphics:::setSettingsValue(key=list("a","b"), value="notMyValue", settings=testSet)
    #> $a -#> $a$b -#> [1] "notMyValue" -#> -#>
    #returns list(a=list(b="notMyValue"))) - -adamSettings<-generateSettings(standard="AdAM") -safetyGraphics:::setSettingsValue(list("id_col"),"customID",adamSettings)
    #> $id_col -#> [1] "customID" -#> -#> $value_col -#> [1] "AVAL" -#> -#> $measure_col -#> [1] "PARAM" -#> -#> $measure_values -#> $measure_values$ALT -#> [1] "Alanine Aminotransferase (U/L)" -#> -#> $measure_values$AST -#> [1] "Aspartate Aminotransferase (U/L)" -#> -#> $measure_values$TB -#> [1] "Bilirubin (umol/L)" -#> -#> $measure_values$ALP -#> [1] "Alkaline Phosphatase (U/L)" -#> -#> -#> $normal_col_low -#> [1] "A1LO" -#> -#> $normal_col_high -#> [1] "A1HI" -#> -#> $studyday_col -#> [1] "ADY" -#> -#> $visit_col -#> [1] "VISIT" -#> -#> $visitn_col -#> [1] "VISITNUM" -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#>
    safetyGraphics:::setSettingsValue(list("measure_values","ALP"),"Alanine Aminotrans",adamSettings)
    #> $id_col -#> [1] "USUBJID" -#> -#> $value_col -#> [1] "AVAL" -#> -#> $measure_col -#> [1] "PARAM" -#> -#> $measure_values -#> $measure_values$ALT -#> [1] "Alanine Aminotransferase (U/L)" -#> -#> $measure_values$AST -#> [1] "Aspartate Aminotransferase (U/L)" -#> -#> $measure_values$TB -#> [1] "Bilirubin (umol/L)" -#> -#> $measure_values$ALP -#> [1] "Alanine Aminotrans" -#> -#> -#> $normal_col_low -#> [1] "A1LO" -#> -#> $normal_col_high -#> [1] "A1HI" -#> -#> $studyday_col -#> [1] "ADY" -#> -#> $visit_col -#> [1] "VISIT" -#> -#> $visitn_col -#> [1] "VISITNUM" -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#>
    safetyGraphics:::setSettingsValue(list("myCustomSetting"),"customized",adamSettings)
    #> $id_col -#> [1] "USUBJID" -#> -#> $value_col -#> [1] "AVAL" -#> -#> $measure_col -#> [1] "PARAM" -#> -#> $measure_values -#> $measure_values$ALT -#> [1] "Alanine Aminotransferase (U/L)" -#> -#> $measure_values$AST -#> [1] "Aspartate Aminotransferase (U/L)" -#> -#> $measure_values$TB -#> [1] "Bilirubin (umol/L)" -#> -#> $measure_values$ALP -#> [1] "Alkaline Phosphatase (U/L)" -#> -#> -#> $normal_col_low -#> [1] "A1LO" -#> -#> $normal_col_high -#> [1] "A1HI" -#> -#> $studyday_col -#> [1] "ADY" -#> -#> $visit_col -#> [1] "VISIT" -#> -#> $visitn_col -#> [1] "VISITNUM" -#> -#> $filters -#> NULL -#> -#> $group_cols -#> NULL -#> -#> $baseline -#> $baseline$value_col -#> NULL -#> -#> $baseline$values -#> NULL -#> -#> -#> $analysisFlag -#> $analysisFlag$value_col -#> NULL -#> -#> $analysisFlag$values -#> NULL -#> -#> -#> $x_options -#> [1] "ALT" "AST" "ALP" -#> -#> $y_options -#> [1] "TB" "ALP" -#> -#> $visit_window -#> [1] 30 -#> -#> $r_ratio_filter -#> [1] TRUE -#> -#> $r_ratio_cut -#> [1] 0 -#> -#> $showTitle -#> [1] TRUE -#> -#> $warningText -#> [1] "Caution: This interactive graphic is not validated. Any clinical recommendations based on this tool should be confirmed using your organizations standard operating procedures." -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#> -#> $visits_without_data -#> [1] FALSE -#> -#> $unscheduled_visits -#> [1] FALSE -#> -#> $unscheduled_visit_pattern -#> [1] "/unscheduled|early termination/i" -#> -#> $calculate_palt -#> NULL -#> -#> $myCustomSetting -#> [1] "customized" -#>
    #adds myCustomSetting to adamSettings - -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/settingsCharts.html b/docs/reference/settingsCharts.html deleted file mode 100644 index e13b6e39..00000000 --- a/docs/reference/settingsCharts.html +++ /dev/null @@ -1,119 +0,0 @@ - -Server for settings tab showing details for the charts loaded in the app — settingsCharts • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for settings tab showing details for the charts loaded in the app

    -
    - -
    -
    settingsCharts(input, output, session, charts)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    charts
    -

    list data frame summarizing the charts

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsChartsUI.html b/docs/reference/settingsChartsUI.html deleted file mode 100644 index 0ffd7613..00000000 --- a/docs/reference/settingsChartsUI.html +++ /dev/null @@ -1,113 +0,0 @@ - -UI for settings tab showing details for the charts loaded in the app — settingsChartsUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for settings tab showing details for the charts loaded in the app

    -
    - -
    -
    settingsChartsUI(id)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsCode.html b/docs/reference/settingsCode.html deleted file mode 100644 index 88b9ca4a..00000000 --- a/docs/reference/settingsCode.html +++ /dev/null @@ -1,123 +0,0 @@ - -Server for settings tab providing code to re-start the app with current data/settings — settingsCode • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for settings tab providing code to re-start the app with current data/settings

    -
    - -
    -
    settingsCode(input, output, session, mapping, charts, domainData)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    mapping
    -

    mapping

    -
    charts
    -

    charts

    -
    domainData
    -

    data list

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsCodeUI.html b/docs/reference/settingsCodeUI.html deleted file mode 100644 index 32b89bf1..00000000 --- a/docs/reference/settingsCodeUI.html +++ /dev/null @@ -1,113 +0,0 @@ - -UI for settings tab providing code to re-start the app with current data/settings — settingsCodeUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for settings tab providing code to re-start the app with current data/settings

    -
    - -
    -
    settingsCodeUI(id)
    -
    - -
    -

    Arguments

    -
    id
    -

    module ID

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsData.html b/docs/reference/settingsData.html deleted file mode 100644 index 4bb8b565..00000000 --- a/docs/reference/settingsData.html +++ /dev/null @@ -1,119 +0,0 @@ - -Server for settings tab showing current data — settingsData • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for settings tab showing current data

    -
    - -
    -
    settingsData(input, output, session, domains)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    domains
    -

    named list of the data.frames for each domain

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsDataUI.html b/docs/reference/settingsDataUI.html deleted file mode 100644 index 42619ca3..00000000 --- a/docs/reference/settingsDataUI.html +++ /dev/null @@ -1,113 +0,0 @@ - -UI for settings tab showing current data — settingsDataUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for settings tab showing current data

    -
    - -
    -
    settingsDataUI(id)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsMapping.html b/docs/reference/settingsMapping.html deleted file mode 100644 index 457fd910..00000000 --- a/docs/reference/settingsMapping.html +++ /dev/null @@ -1,121 +0,0 @@ - -Server for settings tab showing current mapping — settingsMapping • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for settings tab showing current mapping

    -
    - -
    -
    settingsMapping(input, output, session, metadata, mapping)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    metadata
    -

    Data mapping metadata used for initial loading of app

    -
    mapping
    -

    reactive data frame representing the current metadata mapping. columns = "domain", "text_id" and "current"

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsMappingUI.html b/docs/reference/settingsMappingUI.html deleted file mode 100644 index e8ea6262..00000000 --- a/docs/reference/settingsMappingUI.html +++ /dev/null @@ -1,113 +0,0 @@ - -UI for settings tab showing current mapping — settingsMappingUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for settings tab showing current mapping

    -
    - -
    -
    settingsMappingUI(id)
    -
    - -
    -

    Arguments

    -
    id
    -

    module id

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsMetadata.html b/docs/reference/settingsMetadata.html deleted file mode 100644 index b8d0ea4a..00000000 --- a/docs/reference/settingsMetadata.html +++ /dev/null @@ -1,198 +0,0 @@ - - - - - - - - -Settings Metadata — settingsMetadata • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Metadata about the settings used to configure safetyGraphics charts. One record per unique setting

    - -
    - -
    settingsMetadata
    - -

    Format

    - -

    A data frame with 29 rows and 17 columns

    -
    chart_hepexplorer

    Flag indicating if the settings apply to the Hepatic Explorer Chart

    -
    chart_paneledoutlierexplorer

    Flag indicating if the settings apply to the Paneled Safety Outlier Explorer Chart

    -
    chart_safetyhistogram

    Flag indicating if the settings apply to the Safety Histogram Chart

    -
    chart_safetyoutlierexplorer

    Flag indicating if the settings apply to the Safety Outlier Explorer Chart

    -
    chart_safetyresultsovertime

    Flag indicating if the settings apply to the Safety Results Over Time Chart

    -
    chart_safetyshiftplot

    Flag indicating if the settings apply to the Safety Shift Plot Chart

    -
    chart_safetydeltadelta

    Flag indicating if the settings apply to the Safety Delta-Delta Chart

    -
    text_key

    Text key indicating the setting name. '--' delimiter indicates a nested setting

    -
    label

    Label

    -
    description

    Description

    -
    setting_type

    Expected type for setting value. Should be "character", "vector", "numeric" or "logical"

    -
    setting_required

    Flag indicating if the setting is required

    -
    column_mapping

    Flag indicating if the setting corresponds to a column in the associated data

    -
    column_type

    Expected type for the data column values. Should be "character","logical" or "numeric"

    -
    field_mapping

    Flag indicating whether the setting corresponds to a field-level mapping in the data

    -
    field_column_key

    Key for the column that provides options for the field-level mapping in the data

    -
    setting_cat

    Setting category (data, measure, appearance)

    -
    default

    Default value for non-data settings

    - -
    - -

    Source

    - -

    Created for this package

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/settingsTab.html b/docs/reference/settingsTab.html deleted file mode 100644 index 7186a2ee..00000000 --- a/docs/reference/settingsTab.html +++ /dev/null @@ -1,125 +0,0 @@ - -Server for the setting page — settingsTab • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Server for the setting page

    -
    - -
    -
    settingsTab(input, output, session, domains, metadata, mapping, charts)
    -
    - -
    -

    Arguments

    -
    input
    -

    Shiny input object

    -
    output
    -

    Shiny output object

    -
    session
    -

    Shiny session object

    -
    domains
    -

    domains

    -
    metadata
    -

    metadata

    -
    mapping
    -

    mapping

    -
    charts
    -

    charts

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/settingsTabUI.html b/docs/reference/settingsTabUI.html deleted file mode 100644 index a91efbdf..00000000 --- a/docs/reference/settingsTabUI.html +++ /dev/null @@ -1,113 +0,0 @@ - -UI for the settings tab — settingsTabUI • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    UI for the settings tab

    -
    - -
    -
    settingsTabUI(id)
    -
    - -
    -

    Arguments

    -
    id
    -

    module ID

    -
    - -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/standardsMetadata.html b/docs/reference/standardsMetadata.html deleted file mode 100644 index 3cf49d08..00000000 --- a/docs/reference/standardsMetadata.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - -Standards Metadata — standardsMetadata • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Metadata about the data standards used to configure safetyGraphics charts. One record per unique setting. Columns contain default setting values for clinical data standards, like the CDISC "adam" and "sdtm" standards.

    - -
    - -
    standardsMetadata
    - -

    Format

    - -

    A data frame with 25 rows and 3 columns

    -
    text_key

    Text key indicating the setting name. '--' delimiter indicates a nested setting

    -
    adam

    Settings values for the ADaM standard

    -
    sdtm

    Settings values for the SDTM standard

    - -
    - -

    Source

    - -

    Created for this package

    - - -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/textKeysToList.html b/docs/reference/textKeysToList.html deleted file mode 100644 index 47885c93..00000000 --- a/docs/reference/textKeysToList.html +++ /dev/null @@ -1,145 +0,0 @@ - -Helper function to convert keys from text to nested lists — textKeysToList • safetyGraphics - - -
    -
    - - - -
    -
    - - -
    -

    Convert settings keys from text vectors (using the "--" delimiter) to a list of lists

    -
    - -
    -
    textKeysToList(textKeys)
    -
    - -
    -

    Arguments

    -
    textKeys
    -

    a list (or vector) of character keys using the "--" delimiter to indicate hierarchy

    -
    -
    -

    Value

    -

    A list of unnamed lists, with position in the nested list indicating hierarchy

    -
    - -
    -

    Examples

    -
    safetyGraphics:::textKeysToList("id_col") 
    -#> [[1]]
    -#> [[1]][[1]]
    -#> [1] "id_col"
    -#> 
    -#> 
    -#list(list("id_col"))
    -
    -#list(list("id_col"),list("measure_col","label"))
    -safetyGraphics:::textKeysToList(c("id_col","measure_col--label")) 
    -#> [[1]]
    -#> [[1]][[1]]
    -#> [1] "id_col"
    -#> 
    -#> 
    -#> [[2]]
    -#> [[2]][[1]]
    -#> [1] "measure_col"
    -#> 
    -#> [[2]][[2]]
    -#> [1] "label"
    -#> 
    -#> 
    -
    -
    -
    -
    - -
    - - -
    - -
    -

    Site built with pkgdown 2.0.2.

    -
    - -
    - - - - - - - - diff --git a/docs/reference/trimData.html b/docs/reference/trimData.html deleted file mode 100644 index 22192253..00000000 --- a/docs/reference/trimData.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - -Removes unnecessary rows and columns — trimData • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    Removes unnecessary rows and columns from data based on current settings

    - -
    - -
    trimData(data, settings, charts = NULL)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    data

    a data frame to trim

    settings

    the settings list used to determine which rows and columns to drop

    charts

    the charts being created Default: NULL (include data needed for all available charts).

    - -

    Value

    - -

    A dataframe with unnecessary columns and rows removed

    - - -

    Examples

    -
    testSettings <- generateSettings(standard="adam") -trimmed<-safetyGraphics:::trimData(data=adlbc, settings=testSettings)
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/trimSettings.html b/docs/reference/trimSettings.html deleted file mode 100644 index 4499e6d6..00000000 --- a/docs/reference/trimSettings.html +++ /dev/null @@ -1,227 +0,0 @@ - - - - - - - - -Subset a settings object to those relevant for a list of charts — trimSettings • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function returns a settings object

    - -
    - -
    trimSettings(settings, charts = NULL)
    - -

    Arguments

    - - - - - - - - - - -
    settings

    The settings list to subset

    charts

    The charts to subset by

    - -

    Value

    - -

    A list containing settings subsetted for the selected charts

    - -

    Details

    - -

    This function returns a settings object subsetted to the settings relevant to a vector of charts

    - - -

    Examples

    -
    testSettings <- generateSettings(standard="adam") -trimSettings(settings=testSettings, charts = c("safetyhistogram","edish"))
    #> $id_col -#> [1] "USUBJID" -#> -#> $value_col -#> [1] "AVAL" -#> -#> $measure_col -#> [1] "PARAM" -#> -#> $normal_col_low -#> [1] "A1LO" -#> -#> $normal_col_high -#> [1] "A1HI" -#> -#> $filters -#> NULL -#> -#> $unit_col -#> NULL -#> -#> $start_value -#> NULL -#> -#> $details -#> NULL -#> -#> $missingValues -#> [1] "" "NA" "N/A" -#>
    -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/reference/validateSettings.html b/docs/reference/validateSettings.html deleted file mode 100644 index df8b5181..00000000 --- a/docs/reference/validateSettings.html +++ /dev/null @@ -1,307 +0,0 @@ - - - - - - - - -Compare a settings object with a specified data set — validateSettings • safetyGraphics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - - -
    - -
    -
    - - -
    - -

    This function returns a list describing the validation status of a data set for a specified data standard

    - -
    - -
    validateSettings(data, settings, charts = NULL)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    data

    A data frame to check against the settings object

    settings

    The settings list to compare with the data frame.

    charts

    The charts being validated

    - -

    Value

    - -

    A list describing the validation state for the data/settings combination. The returned list has the following properties:

      -
    • "valid" - boolean indicating whether the settings/data combo is valid for all charts

    • -
    • "status" - string summarizing the validation results

    • -
    • "charts" - a list of lists specifying whether each chart is valid. Each item in the list has "chart" and "valid" properties

    • -
    • "checkList" - list of lists giving details about checks performed on individual setting specifications. Each embedded item has the following properties:

        -
      • "key" - list specifying the position of the property being checked. For example, `list("group_cols",1,"value_col")` corresponds to `settings[["group_cols"]][[1]][["value_col"]]`

      • -
      • "text_key" - list from `key` parsed to character with a "--" separator.

      • -
      • "value" - value of the setting

      • -
      • "type" - type of the check performed.

      • -
      • "description" - description of the check performed.

      • -
      • "valid" - boolean indicating whether the check was passed

      • -
      • "message" - string describing failed checks (where `valid=FALSE`). returns an empty string when `valid==TRUE`

      • -
    • -
    - - -

    Details

    - -

    This function returns a list describing the validation status of a settings/data combo for a given chart type. This list can be used to populate status fields and control workflow in the Shiny app. It could also be used to manually QC a buggy chart. The tool checks that all setting properties containing "_col" match columns in the data set via checkColumnSettings, and all properties containing "_values" match fields in the data set via checkFieldSettings.

    - - -

    Examples

    -
    testSettings <- generateSettings(standard="adam") -validateSettings(data=adlbc, settings=testSettings)
    #> $checks -#> # A tibble: 33 x 7 -#> key text_key type description value valid message -#> <list> <chr> <chr> <chr> <chr> <lgl> <chr> -#> 1 <list … id_col requi… value for specified … USUBJID TRUE "" -#> 2 <list … value_col requi… value for specified … AVAL TRUE "" -#> 3 <list … measure_col requi… value for specified … PARAM TRUE "" -#> 4 <list … measure_val… requi… value for specified … Alanine Amin… TRUE "" -#> 5 <list … measure_val… requi… value for specified … Aspartate Am… TRUE "" -#> 6 <list … measure_val… requi… value for specified … Bilirubin (u… TRUE "" -#> 7 <list … measure_val… requi… value for specified … Alkaline Pho… TRUE "" -#> 8 <list … normal_col_… requi… value for specified … A1LO TRUE "" -#> 9 <list … normal_col_… requi… value for specified … A1HI TRUE "" -#> 10 <list … studyday_col requi… value for specified … ADY TRUE "" -#> # … with 23 more rows -#> -#> $valid -#> [1] TRUE -#> -#> $charts -#> $charts$hepexplorer -#> [1] TRUE -#> -#> $charts$safetyhistogram -#> [1] TRUE -#> -#> $charts$safetyoutlierexplorer -#> [1] TRUE -#> -#> $charts$safetyshiftplot -#> [1] TRUE -#> -#> $charts$safetyresultsovertime -#> [1] TRUE -#> -#> $charts$paneledoutlierexplorer -#> [1] TRUE -#> -#> $charts$safetydeltadelta -#> [1] TRUE -#> -#> -#> $status -#> [1] "0 of 33 checks failed." -#>
    # .$valid is TRUE -testSettings$id_col <- "NotAColumn" -validateSettings(data=adlbc, settings=testSettings)
    #> $checks -#> # A tibble: 33 x 7 -#> key text_key type description value valid message -#> <list> <chr> <chr> <chr> <chr> <lgl> <chr> -#> 1 <list … id_col requi… value for specified … NotAColumn TRUE "" -#> 2 <list … value_col requi… value for specified … AVAL TRUE "" -#> 3 <list … measure_col requi… value for specified … PARAM TRUE "" -#> 4 <list … measure_val… requi… value for specified … Alanine Amin… TRUE "" -#> 5 <list … measure_val… requi… value for specified … Aspartate Am… TRUE "" -#> 6 <list … measure_val… requi… value for specified … Bilirubin (u… TRUE "" -#> 7 <list … measure_val… requi… value for specified … Alkaline Pho… TRUE "" -#> 8 <list … normal_col_… requi… value for specified … A1LO TRUE "" -#> 9 <list … normal_col_… requi… value for specified … A1HI TRUE "" -#> 10 <list … studyday_col requi… value for specified … ADY TRUE "" -#> # … with 23 more rows -#> -#> $valid -#> [1] FALSE -#> -#> $charts -#> $charts$hepexplorer -#> [1] FALSE -#> -#> $charts$safetyhistogram -#> [1] FALSE -#> -#> $charts$safetyoutlierexplorer -#> [1] FALSE -#> -#> $charts$safetyshiftplot -#> [1] FALSE -#> -#> $charts$safetyresultsovertime -#> [1] FALSE -#> -#> $charts$paneledoutlierexplorer -#> [1] FALSE -#> -#> $charts$safetydeltadelta -#> [1] FALSE -#> -#> -#> $status -#> [1] "1 of 33 checks failed." -#>
    # .$valid is now FALSE - -
    -
    - -
    - - -
    - - -
    -

    Site built with pkgdown 1.4.1.

    -
    - -
    -
    - - - - - - - - diff --git a/docs/sitemap.xml b/docs/sitemap.xml deleted file mode 100644 index 8fc6cc47..00000000 --- a/docs/sitemap.xml +++ /dev/null @@ -1,276 +0,0 @@ - - - - https://safetygraphics.github.io/safetyGraphics/404.html - - - https://safetygraphics.github.io/safetyGraphics/LICENSE-text.html - - - https://safetygraphics.github.io/safetyGraphics/LICENSE.html - - - https://safetygraphics.github.io/safetyGraphics/articles/Cookbook.html - - - https://safetygraphics.github.io/safetyGraphics/articles/TechnicalFAQ.html - - - https://safetygraphics.github.io/safetyGraphics/articles/chartConfiguration.html - - - https://safetygraphics.github.io/safetyGraphics/articles/customWorkflows.html - - - https://safetygraphics.github.io/safetyGraphics/articles/index.html - - - https://safetygraphics.github.io/safetyGraphics/articles/intro.html - - - https://safetygraphics.github.io/safetyGraphics/articles/shinyUserGuide.html - - - https://safetygraphics.github.io/safetyGraphics/authors.html - - - https://safetygraphics.github.io/safetyGraphics/index.html - - - https://safetygraphics.github.io/safetyGraphics/news/index.html - - - https://safetygraphics.github.io/safetyGraphics/reference/SafetyGraphics.html - - - https://safetygraphics.github.io/safetyGraphics/reference/addChart.html - - - https://safetygraphics.github.io/safetyGraphics/reference/addSetting.html - - - https://safetygraphics.github.io/safetyGraphics/reference/adlbc.html - - - https://safetygraphics.github.io/safetyGraphics/reference/app_startup.html - - - https://safetygraphics.github.io/safetyGraphics/reference/chartRenderer-shiny.html - - - https://safetygraphics.github.io/safetyGraphics/reference/chartRenderer.html - - - https://safetygraphics.github.io/safetyGraphics/reference/chartsMetadata.html - - - https://safetygraphics.github.io/safetyGraphics/reference/chartsNav.html - - - https://safetygraphics.github.io/safetyGraphics/reference/chartsTab.html - - - https://safetygraphics.github.io/safetyGraphics/reference/chartsTabUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/checkColumn.html - - - https://safetygraphics.github.io/safetyGraphics/reference/checkField.html - - - https://safetygraphics.github.io/safetyGraphics/reference/checkNumeric.html - - - https://safetygraphics.github.io/safetyGraphics/reference/checkRequired.html - - - https://safetygraphics.github.io/safetyGraphics/reference/createChart.html - - - https://safetygraphics.github.io/safetyGraphics/reference/detectStandard.html - - - https://safetygraphics.github.io/safetyGraphics/reference/evaluateStandard.html - - - https://safetygraphics.github.io/safetyGraphics/reference/filterTab.html - - - https://safetygraphics.github.io/safetyGraphics/reference/filterTabChecks.html - - - https://safetygraphics.github.io/safetyGraphics/reference/filterTabUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/generateMappingList.html - - - https://safetygraphics.github.io/safetyGraphics/reference/generateSettings.html - - - https://safetygraphics.github.io/safetyGraphics/reference/generateShell.html - - - https://safetygraphics.github.io/safetyGraphics/reference/getRequiredSettings.html - - - https://safetygraphics.github.io/safetyGraphics/reference/getSettingKeys.html - - - https://safetygraphics.github.io/safetyGraphics/reference/getSettingValue.html - - - https://safetygraphics.github.io/safetyGraphics/reference/getSettingsMetadata.html - - - https://safetygraphics.github.io/safetyGraphics/reference/hasColumn.html - - - https://safetygraphics.github.io/safetyGraphics/reference/hasField.html - - - https://safetygraphics.github.io/safetyGraphics/reference/homeTab.html - - - https://safetygraphics.github.io/safetyGraphics/reference/homeTabUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/index.html - - - https://safetygraphics.github.io/safetyGraphics/reference/loadCharts.html - - - https://safetygraphics.github.io/safetyGraphics/reference/loadChartsUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/loadData.html - - - https://safetygraphics.github.io/safetyGraphics/reference/loadDataUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/makeChartConfig.html - - - https://safetygraphics.github.io/safetyGraphics/reference/makeChartExport.html - - - https://safetygraphics.github.io/safetyGraphics/reference/makeChartParams.html - - - https://safetygraphics.github.io/safetyGraphics/reference/makeChartSummary.html - - - https://safetygraphics.github.io/safetyGraphics/reference/makeMapping.html - - - https://safetygraphics.github.io/safetyGraphics/reference/makeMeta.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingColumn.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingColumnUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingDomain.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingDomainUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingSelect.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingSelectUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingTab.html - - - https://safetygraphics.github.io/safetyGraphics/reference/mappingTabUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/meta.html - - - https://safetygraphics.github.io/safetyGraphics/reference/pipe.html - - - https://safetygraphics.github.io/safetyGraphics/reference/prepareChart.html - - - https://safetygraphics.github.io/safetyGraphics/reference/removeCharts.html - - - https://safetygraphics.github.io/safetyGraphics/reference/removeSettings.html - - - https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsApp.html - - - https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsInit.html - - - https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsServer.html - - - https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/setMappingListValue.html - - - https://safetygraphics.github.io/safetyGraphics/reference/setSettingsValue.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsCharts.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsChartsUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsCode.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsCodeUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsData.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsDataUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsMapping.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsMappingUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsMetadata.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsTab.html - - - https://safetygraphics.github.io/safetyGraphics/reference/settingsTabUI.html - - - https://safetygraphics.github.io/safetyGraphics/reference/standardsMetadata.html - - - https://safetygraphics.github.io/safetyGraphics/reference/textKeysToList.html - - - https://safetygraphics.github.io/safetyGraphics/reference/trimData.html - - - https://safetygraphics.github.io/safetyGraphics/reference/trimSettings.html - - - https://safetygraphics.github.io/safetyGraphics/reference/validateSettings.html - - diff --git a/vignettes/chartConfiguration.Rmd b/vignettes/ChartConfiguration.Rmd similarity index 100% rename from vignettes/chartConfiguration.Rmd rename to vignettes/ChartConfiguration.Rmd diff --git a/vignettes/Cookbook.Rmd b/vignettes/Cookbook.Rmd index 34454ce4..02b2a112 100644 --- a/vignettes/Cookbook.Rmd +++ b/vignettes/Cookbook.Rmd @@ -133,7 +133,7 @@ Note, that for more complex customizations, the setting page also provides a `.z # Custom Charts -The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this [vignette](chartConfiguration.html). +The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this [vignette](ChartConfiguration.html). ## Example 7 - Drop Unwanted Charts diff --git a/vignettes/intro.Rmd b/vignettes/Intro.Rmd similarity index 99% rename from vignettes/intro.Rmd rename to vignettes/Intro.Rmd index b08e4562..6c505de0 100644 --- a/vignettes/intro.Rmd +++ b/vignettes/Intro.Rmd @@ -57,7 +57,7 @@ Finally, the Settings tab - shown as a gear icon ⚙️ - contains technical de # Loading Study Data -safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in [appendix 2](Intro.html#appendix-2---minimum-data-requirements). +safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in [appendix 2](#appendix-2---minimum-data-requirements). There are 2 primary ways to load your study data in to the safetyGraphics shiny app: diff --git a/vignettes/TechnicalFAQ.Rmd b/vignettes/TechnicalFAQ.Rmd index 33733729..26f8c7fb 100644 --- a/vignettes/TechnicalFAQ.Rmd +++ b/vignettes/TechnicalFAQ.Rmd @@ -45,7 +45,7 @@ Whenever new questions come in, we'll update the version of [this FAQ in our wik ## Q: Is the safetyGraphics app ready for "production" use? -A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a [variety of use cases](TechnicalFAQ.html#q-what-are-some-common-use-cases-for-safetygraphics). The details of a 'production' implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians. +A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a [variety of use cases](#q-what-are-some-common-use-cases-for-safetygraphics). The details of a 'production' implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians. That said, the issues surrounding a 'production' deployment are mostly technical and operational at this point and could likely be overcome by a motivated organization with ample technical expertise. Some of the issues that would need to be addressed in a production deployment: @@ -55,7 +55,7 @@ That said, the issues surrounding a 'production' deployment are mostly technical - Data pipeline for study set-up and customization (Organization-specific) - Issues with big data set performance in htmlwidget renderers -Many of these issues aren't specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. [As discussed above](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ.html#q-is-the-safetygraphics-package-validated), there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible. +Many of these issues aren't specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. [As discussed above](#q-is-the-safetygraphics-package-validated), there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible. Finally, it is worth noting "Productionize” and “Validate” are slightly different. Joe Cheng (the primary author of Shiny) has a [nice talk](https://www.rstudio.com/resources/rstudioconf-2019/shiny-in-production-principles-practices-and-tools/) on this topic from a software engineering perspective. @@ -79,13 +79,13 @@ As an open source tool with a flexible data pipeline, many other use cases have ## Q: Do I have to use a certain data standard with safetyGraphics? -**A**: No. Any standard (or non-standard) data can be loaded as long as it meets the [minimum data requirements](Intro.html#appendix-2---minimum-data-requirements) for the selected data domain. Metadata capturing default CDISC standards are included with the app (see `?safetyGraphics::meta`) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the [cookbook vignette](cookbook) for examples. +**A**: No. Any standard (or non-standard) data can be loaded as long as it meets the [minimum data requirements](Intro.html#appendix-2---minimum-data-requirements) for the selected data domain. Metadata capturing default CDISC standards are included with the app (see `?safetyGraphics::meta`) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the [cookbook vignette](Cookbook.html) for examples. ## Q: What data sources does safetyGraphics support? How do I load custom data? **A**: This topic is covered in detail in the [Loading data section of the Introductory vignette](Intro.html#loading-study-data). `safetyGraphics` is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the `dataDomains` parameter in the `safetyGraphicsApp()` function or via the `safetyGraphicsInit()` graphical user interface. -`safetyGraphicsApp()` - custom data can be loaded via the `dataDomains` parameter, which should be a list containing `dataframes` or `tibbles` for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or [any number of other sources](https://r4ds.had.co.nz/data-import.html). See the [cookbook vignette](cookbook.html) for some basic examples of loading custom data. +`safetyGraphicsApp()` - custom data can be loaded via the `dataDomains` parameter, which should be a list containing `dataframes` or `tibbles` for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or [any number of other sources](https://r4ds.had.co.nz/data-import.html). See the [cookbook vignette](Cookbook.html) for some basic examples of loading custom data. `safetyGraphicsInit()` - allows users to load tabular data from a variety of sources using the point-and-click interface provided in the {datamods} package. @@ -95,7 +95,7 @@ More detail is provided in the [Loading data section of the Introductory vignett Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package. -Just like the discussion regarding [Validation and Quality Control](https://github.com/SafetyGraphics/safetyGraphics/wiki/TechnicalFAQ.html#validation-quality-control-and-testing), data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general ([1](https://www.hhs.gov/ohrp/sites/default/files/report-privacy-and-health-10-31-19.pdf), [2](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4943495/), [3](https://www.d-wise.com/blog/detailing-the-de-identification-and-data-transparency-boundaries-of-ema-policy-70-and-gdpr)) and discussing data security in shiny ([4](https://www.youtube.com/watch?v=5odJxZj9LE4), +Just like the discussion regarding [Validation and Quality Control](#validation-quality-control-and-testing), data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general ([1](https://www.hhs.gov/ohrp/sites/default/files/report-privacy-and-health-10-31-19.pdf), [2](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4943495/), [3](https://www.d-wise.com/blog/detailing-the-de-identification-and-data-transparency-boundaries-of-ema-policy-70-and-gdpr)) and discussing data security in shiny ([4](https://www.youtube.com/watch?v=5odJxZj9LE4), [5](https://mastering-shiny.org/scaling-security.html#data)) - that could help to facilitate these discussion. ## Q: How can the safetyGraphics app be shared? From 1d5008ff04d1511ae195ecb338ba15a1eeaf3f9a Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Fri, 8 Apr 2022 05:34:07 -0400 Subject: [PATCH 41/41] rebuild pkgdown --- docs/404.html | 130 ++++++ docs/LICENSE-text.html | 104 +++++ docs/LICENSE.html | 108 +++++ docs/articles/ChartConfiguration.html | 521 +++++++++++++++++++++++ docs/articles/Cookbook.html | 390 +++++++++++++++++ docs/articles/Intro.html | 278 ++++++++++++ docs/articles/TechnicalFAQ.html | 260 +++++++++++ docs/articles/index.html | 107 +++++ docs/authors.html | 143 +++++++ docs/bootstrap-toc.css | 60 +++ docs/bootstrap-toc.js | 159 +++++++ docs/docsearch.css | 148 +++++++ docs/docsearch.js | 85 ++++ docs/index.html | 187 ++++++++ docs/link.svg | 12 + docs/news/index.html | 130 ++++++ docs/pkgdown.css | 384 +++++++++++++++++ docs/pkgdown.js | 108 +++++ docs/pkgdown.yml | 13 + docs/reference/Rplot001.png | Bin 0 -> 1011 bytes docs/reference/SafetyGraphics.html | 111 +++++ docs/reference/app_startup.html | 141 ++++++ docs/reference/chartsNav.html | 115 +++++ docs/reference/chartsTab.html | 123 ++++++ docs/reference/chartsTabUI.html | 115 +++++ docs/reference/detectStandard.html | 337 +++++++++++++++ docs/reference/evaluateStandard.html | 217 ++++++++++ docs/reference/filterTab.html | 140 ++++++ docs/reference/filterTabChecks.html | 121 ++++++ docs/reference/filterTabUI.html | 113 +++++ docs/reference/generateMappingList.html | 117 +++++ docs/reference/hasColumn.html | 128 ++++++ docs/reference/hasField.html | 141 ++++++ docs/reference/homeTab.html | 117 +++++ docs/reference/homeTabUI.html | 113 +++++ docs/reference/index.html | 290 +++++++++++++ docs/reference/loadCharts.html | 119 ++++++ docs/reference/loadChartsUI.html | 115 +++++ docs/reference/loadData.html | 119 ++++++ docs/reference/loadDataUI.html | 115 +++++ docs/reference/makeChartConfig.html | 139 ++++++ docs/reference/makeChartExport.html | 119 ++++++ docs/reference/makeChartParams.html | 117 +++++ docs/reference/makeChartSummary.html | 117 +++++ docs/reference/makeMapping.html | 124 ++++++ docs/reference/makeMeta.html | 156 +++++++ docs/reference/mappingColumn.html | 125 ++++++ docs/reference/mappingColumnUI.html | 119 ++++++ docs/reference/mappingDomain.html | 125 ++++++ docs/reference/mappingDomainUI.html | 119 ++++++ docs/reference/mappingSelect.html | 121 ++++++ docs/reference/mappingSelectUI.html | 123 ++++++ docs/reference/mappingTab.html | 125 ++++++ docs/reference/mappingTabUI.html | 121 ++++++ docs/reference/pipe.html | 108 +++++ docs/reference/prepareChart.html | 117 +++++ docs/reference/safetyGraphicsApp.html | 137 ++++++ docs/reference/safetyGraphicsInit.html | 121 ++++++ docs/reference/safetyGraphicsServer.html | 136 ++++++ docs/reference/safetyGraphicsUI.html | 121 ++++++ docs/reference/setMappingListValue.html | 136 ++++++ docs/reference/settingsCharts.html | 119 ++++++ docs/reference/settingsChartsUI.html | 113 +++++ docs/reference/settingsCode.html | 123 ++++++ docs/reference/settingsCodeUI.html | 113 +++++ docs/reference/settingsData.html | 119 ++++++ docs/reference/settingsDataUI.html | 113 +++++ docs/reference/settingsMapping.html | 121 ++++++ docs/reference/settingsMappingUI.html | 113 +++++ docs/reference/settingsTab.html | 125 ++++++ docs/reference/settingsTabUI.html | 113 +++++ docs/reference/textKeysToList.html | 145 +++++++ docs/sitemap.xml | 192 +++++++++ 73 files changed, 10369 insertions(+) create mode 100644 docs/404.html create mode 100644 docs/LICENSE-text.html create mode 100644 docs/LICENSE.html create mode 100644 docs/articles/ChartConfiguration.html create mode 100644 docs/articles/Cookbook.html create mode 100644 docs/articles/Intro.html create mode 100644 docs/articles/TechnicalFAQ.html create mode 100644 docs/articles/index.html create mode 100644 docs/authors.html create mode 100644 docs/bootstrap-toc.css create mode 100644 docs/bootstrap-toc.js create mode 100644 docs/docsearch.css create mode 100644 docs/docsearch.js create mode 100644 docs/index.html create mode 100644 docs/link.svg create mode 100644 docs/news/index.html create mode 100644 docs/pkgdown.css create mode 100644 docs/pkgdown.js create mode 100644 docs/pkgdown.yml create mode 100644 docs/reference/Rplot001.png create mode 100644 docs/reference/SafetyGraphics.html create mode 100644 docs/reference/app_startup.html create mode 100644 docs/reference/chartsNav.html create mode 100644 docs/reference/chartsTab.html create mode 100644 docs/reference/chartsTabUI.html create mode 100644 docs/reference/detectStandard.html create mode 100644 docs/reference/evaluateStandard.html create mode 100644 docs/reference/filterTab.html create mode 100644 docs/reference/filterTabChecks.html create mode 100644 docs/reference/filterTabUI.html create mode 100644 docs/reference/generateMappingList.html create mode 100644 docs/reference/hasColumn.html create mode 100644 docs/reference/hasField.html create mode 100644 docs/reference/homeTab.html create mode 100644 docs/reference/homeTabUI.html create mode 100644 docs/reference/index.html create mode 100644 docs/reference/loadCharts.html create mode 100644 docs/reference/loadChartsUI.html create mode 100644 docs/reference/loadData.html create mode 100644 docs/reference/loadDataUI.html create mode 100644 docs/reference/makeChartConfig.html create mode 100644 docs/reference/makeChartExport.html create mode 100644 docs/reference/makeChartParams.html create mode 100644 docs/reference/makeChartSummary.html create mode 100644 docs/reference/makeMapping.html create mode 100644 docs/reference/makeMeta.html create mode 100644 docs/reference/mappingColumn.html create mode 100644 docs/reference/mappingColumnUI.html create mode 100644 docs/reference/mappingDomain.html create mode 100644 docs/reference/mappingDomainUI.html create mode 100644 docs/reference/mappingSelect.html create mode 100644 docs/reference/mappingSelectUI.html create mode 100644 docs/reference/mappingTab.html create mode 100644 docs/reference/mappingTabUI.html create mode 100644 docs/reference/pipe.html create mode 100644 docs/reference/prepareChart.html create mode 100644 docs/reference/safetyGraphicsApp.html create mode 100644 docs/reference/safetyGraphicsInit.html create mode 100644 docs/reference/safetyGraphicsServer.html create mode 100644 docs/reference/safetyGraphicsUI.html create mode 100644 docs/reference/setMappingListValue.html create mode 100644 docs/reference/settingsCharts.html create mode 100644 docs/reference/settingsChartsUI.html create mode 100644 docs/reference/settingsCode.html create mode 100644 docs/reference/settingsCodeUI.html create mode 100644 docs/reference/settingsData.html create mode 100644 docs/reference/settingsDataUI.html create mode 100644 docs/reference/settingsMapping.html create mode 100644 docs/reference/settingsMappingUI.html create mode 100644 docs/reference/settingsTab.html create mode 100644 docs/reference/settingsTabUI.html create mode 100644 docs/reference/textKeysToList.html create mode 100644 docs/sitemap.xml diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 00000000..7beff27e --- /dev/null +++ b/docs/404.html @@ -0,0 +1,130 @@ + + + + + + + +Page not found (404) • safetyGraphics + + + + + + + + + + + +
    +
    + + + + +
    +
    + + +Content not found. Please use links in the navbar. + +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.2.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html new file mode 100644 index 00000000..6267e809 --- /dev/null +++ b/docs/LICENSE-text.html @@ -0,0 +1,104 @@ + +License • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    YEAR: 2021
    +COPYRIGHT HOLDER: safetyGraphics authors
    +
    + +
    + + + +
    + + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html new file mode 100644 index 00000000..45f5f258 --- /dev/null +++ b/docs/LICENSE.html @@ -0,0 +1,108 @@ + +MIT License • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    + +

    Copyright (c) 2021 safetyGraphics authors

    +

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    +

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

    +

    THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    +
    + +
    + + + +
    + + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/articles/ChartConfiguration.html b/docs/articles/ChartConfiguration.html new file mode 100644 index 00000000..39b5bc02 --- /dev/null +++ b/docs/articles/ChartConfiguration.html @@ -0,0 +1,521 @@ + + + + + + + +Chart Configuration • safetyGraphics + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Chart Configuration Vignette +

    +

    The {safetyGraphics} shiny app can be used to display a wide variety of charts. This vignette provides details about the charting process including step-by-step instructions for adding new charts and technical specifications, but first we need to talk about a 2nd package …

    +
    +
    +

    Introducing {safetyCharts} +

    +

    While this is technically a vignette for {safetyGraphics}, the {safetyCharts} package is just as important here. The roles of the packages can be summarized in just a few words:

    +

    The {safetyGraphics} platform displays charts from {safetyCharts}.

    +

    This relationship is central to the technical framework for the safetyGraphics app. By itself, the safetyGraphics platform really doesn’t do much! In fact, none of the content on the Charts tab is actually found in the safetyGraphics package; it’s all imported from elsewhere! As you’ve probably guessed, the default charts live in the safetyCharts package. safetyCharts has over a dozen charts that are configured to work with {safetyGraphics}, but can also easily be used independently.

    +

    While {safetyGraphics} and {safetyCharts} are designed to work seamlessly together, users can also add charts from other packages. In fact, several charts in {safetyCharts} are just wrappers that load charts from other packages for use in {safetyGraphics}. The rest of this vignette provides a series of step-by-step examples detailing how this process works for different types of charts.

    +
    +
    +

    {safetyGraphics} Chart Components +

    +

    To add a chart to safetyGraphics, two components are required:

    +
      +
    1. A Configuration Object
    2. +
    3. A Chart Function
    4. +
    +

    The configuration file captures metadata about the chart for use in the app and is typically saved as a YAML file. Several example configuration files are provided in the examples below, and YAML Configuration files for {safetyCharts} are saved here.

    +

    The chart function typically takes a list of settings and a list of data as inputs and returns a chart object ready to be displayed in the app. Details of charting functions vary somewhat for different chart types, as explained in the examples below.

    +

    A full technical specification of this chart configuration framework is provided in Appendix 1.

    +
    +
    +

    Example 1 - Hello World +

    +

    Once you’ve created the configuration and chart functions, the chart can be added to the app via the charts parameter in safetyGraphicsApp(). Consider this simple “Hello World” example:

    +
    # Chart Function
    +helloWorld <- function(data, settings){
    +    plot(-1:1, -1:1)
    +    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    +}
    +
    +# Chart Configuration
    +helloworld_chart<-list(
    +    env="safetyGraphics",
    +    name="HelloWorld",
    +    label="Hello World!",
    +    type="plot",
    +    domain="aes",
    +    workflow=list(
    +        main="helloWorld"
    +    )
    +)
    +
    +safetyGraphicsApp(charts=list(helloworld_chart))
    +

    It’s also easy to add a custom chart to the default charts provided in {safetyCharts} using the makeChartConfig() function:

    +
    charts <- makeChartConfig(packages="safetyCharts") # or just makeChartConfig() since safetyCharts is included by default
    +charts$helloworld<-helloworld_chart
    +safetyGraphicsApp(charts=charts)
    +

    Here’s our Hello World the chart running in the app:

    +

    +
    +
    +

    Example 2 - Static Outlier Explorer +

    +

    Now let’s consider a more complex example that makes use of the data and settings provided in safetyGraphics. In this section, we use {ggplot2} to create a spaghetti plot for tracking outliers in lab data. First, consider the following code which creates a stand-alone plot for a single data set:

    +
    # Use sample clinical trial data sets from the {safetyData} package
    +library(safetyData) 
    +library(ggplot2)
    +library(dplyr)
    +
    +# Define data mapping using a format similar to a reactive safetyGraphics mapping 
    +settings <- list(
    +    id_col="USUBJID",
    +    value_col="LBSTRESN",
    +    measure_col="LBTEST",
    +    studyday_col="LBDY"
    +)
    +
    +# Define a plotting function that takes data and settings as inputs 
    +spaghettiPlot <- function( data, settings ){
    +    # define plot aes - note use of standard evaluation! 
    +    plot_aes <- aes(
    +        x=.data[[settings$studyday_col]], 
    +        y=.data[[settings$value_col]], 
    +        group=.data[[settings$id_col]]
    +    )
    +
    +    #create the plot
    +    p<-ggplot(data = data, plot_aes) +
    +        geom_path(alpha=0.15) + 
    +        facet_wrap(
    +            settings$measure_col,
    +            scales="free_y"
    +        )
    +    return(p)
    +}
    +
    +spaghettiPlot(
    +    safetyData::sdtm_lb %>% 
    +        filter(LBTEST %in% c("Albumin","Bilirubin","Calcium","Chloride")), 
    +    settings
    +)
    +

    Running the code above should create a plot with 4 panels:

    +

    +

    With minor modifications, this chart can be added to the {safetyGraphics} shiny app, which allows us to create the chart with any mappings/data combination loaded in the app. The spaghettiPlot() function above is already written to work with safetyGraphics, so we just need to create the chart configuration object. This time we’ll capture the configuration in a YAML file.

    +
    env: safetyGraphics
    +label: Spaghetti Plot
    +name: spaghettiPlot
    +type: plot
    +domain: 
    +    - labs
    +workflow:
    +    main: spaghettiPlot
    +links:
    +    safetyCharts: https://github.com/SafetyGraphics/safetycharts
    +

    With the charting function loaded in to our session and the configuration file saved in our working directory as spaghetti.yaml, we can add the chart to the app as follows:

    +
    library(yaml)
    +charts <- makeChartConfig()
    +charts$spaghetti<-prepareChart(read_yaml('spaghetti.yaml'))
    +safetyGraphicsApp(charts=charts)
    +

    Under the charts tab, you’ll see:

    +

    +

    If you look closely at the spaghettiPlot() code above, you’ll noticed some details that make the chart work in the app:

    +
      +
    • The chart function is written as a function taking data and settings as inputs. This is the expected parameterization for most charts in {safetyGraphics}.
    • +
    • The references to settings use parameters that are defined on the mapping tab. Behind the scenes, these are defined in the safetyGraphics::meta.
    • +
    • The spaghettiPlot function is referenced in the main item the YAML workflow. This tells the app which function to use to draw the chart.
    • +
    • We’re using the .data[[]] pronoun in the chart function to access columns in the data based on the current settings. See these references for a lot more detail about functional programming in the tidyverse: + +
    • +
    +

    This example is inspired by safetyCharts::safety_outlier_explorer - the charting function and yaml configuration file on are GitHub.

    +
    +
    +

    Example 3 - Shiny Module +

    +

    {safetyGraphics} also supports defining charts as Shiny Modules. Once you’re familiar with modules, they are relatively straightforward to use with safetyGraphics.

    +

    Let’s take a look at a simple module that extends the functionality of the static chart from the example above. Once again, this example is based upon safetyCharts, and you can see the code and config on GitHub.

    +

    The config object for a module differs from a static chart is that the workflow section of the YAML file must specify ui and server functions instead of a main charting function. This example defines a simple UI function that allows users to select which lab measurements should be included in the spaghetti plot from example 1:

    +
    safetyOutlierExplorer_ui <- function(id) {
    +    ns <- NS(id) 
    +    sidebar<-sidebarPanel(
    +        selectizeInput(
    +            ns("measures"), 
    +            "Select Measures", 
    +            multiple=TRUE, 
    +            choices=c("")
    +        )
    +    )
    +    main<-mainPanel(plotOutput(ns("outlierExplorer")))
    +    ui<-fluidPage(
    +        sidebarLayout(
    +            sidebar,
    +            main,
    +            position = c("right"),
    +            fluid=TRUE
    +        )
    +    )
    +    return(ui)
    +}
    +

    Next we define a server function that populates the control for selecting measurements and then draws the plot using safetyCharts::safety_outlier_explorer() charting function - which is based on the spaghetti() function! Note that the server function takes a single reactive params object containing the data (params$data) and settings (param$settings) as input.

    +
    safetyOutlierExplorer_server <- function(input, output, session, params) {
    +
    +    ns <- session$ns
    +    # Populate control with measures and select all by default
    +    observe({
    +        measure_col <- params()$settings$measure_col
    +        measures <- unique(params()$data[[measure_col]])
    +        updateSelectizeInput(
    +            session, 
    +            "measures",
    +            choices = measures,
    +            selected = measures
    +        )
    +    })
    +
    +    # customize selected measures based on input
    +    settingsR <- reactive({
    +        settings <- params()$settings
    +        settings$measure_values <- input$measures
    +        return(settings)
    +    })
    +
    +    #draw the chart
    +    output$outlierExplorer <- renderPlot({safety_outlier_explorer(params()$data, settingsR())})
    +}
    +

    Finally, the YAML configuration file looks like this - just the workflow and label changes from Example 1:

    +
    env: safetyGraphics
    +label: Outlier Explorer - Module
    +name: outlierExplorerMod
    +type: module
    +package: safetyCharts
    +domain: 
    +    - labs
    +workflow:
    +    ui: safetyOutlierExplorer_ui
    +    server: safetyOutlierExplorer_server
    +links:
    +    safetyCharts: https://github.com/SafetyGraphics/safetycharts
    +

    Initializing the app as usual by adding it to the chart list: charts$outlierMod<-prepareChart(read_yaml('outlierMod.yaml'))

    +

    Unselecting a few measures gives the following display:

    +
    +
    +

    Example 4 - htmlwidgets and init functions +

    +

    You can also add custom htmlwidgets to safetyGraphics. In fact, many of the default charts imported from safetyCharts are javascript libraries that are imported as htmlwidgets. Like shiny modules, htmlwidgets are relatively simple to use once you are familiar with the basics.

    +

    The biggest differences between widgets and other charts in safetyGraphics are:

    +
      +
    1. The widget must be contained in a package, which must be specified in the YAML file.
    2. +
    3. The widget expects a widget item giving the name of the widget in the YAML workflow.
    4. +
    5. By default, the data and settings for a widget are passed in a list (list(data=data, settings=settings)) to the x parameter in htmlwidget::createWidget.
    6. +
    +

    Items 1 and 2 above are simple enough, but #3 is likely to create problems unless the widget is designed specifically for usage with safetyGraphics. That is, if the widget isn’t expecting x$settings to be a list that it uses to configure the chart, it probably isn’t going to work as expected.

    +

    Fortunately, there’s a workaround built in to safetyGraphics in the form of init workflow functions. Init functions run before the chart is drawn, and can be used to create custom parameterizations. The init function should take data and settings as inputs and return params which should be a list which is then provided to the chart (see the appendix for more details). The init function for the the interactive AE Explorer is a good example. It starts by merging demographics and adverse event data and then proceeds to create a customized settings object to match the configuration requirements of the javascript chart renderer. This init function is then saved under workflow$init in the chart config object.

    +

    The rest of the chart configuration YAML is similar to the examples above, and the chart is once again by passing the chart config object to safetyGraphicsApp()

    +
    +
    +

    Example 5 - Adding a Chart in a New Data Domain +

    +

    All of our examples so far have been focused on creating charts in our 3 default data domains (labs, adverse events and demographics), but there is no requirement that limits charts to these three data types. The data domains in the app are determined by a meta data frame that defines the columns and fields used in safetyGraphics charts, and customizing meta allows us to create charts for any desired data domains.

    +

    Generally speaking there are 3 steps to add a chart in a new domain:

    +
      +
    1. Create Metadata for a new data domain.
    2. +
    3. Define a chart using the new domain - like the examples above
    4. +
    5. Load data for the new domain
    6. +
    +

    Consider the following example, that modifies a chart from the labs domain for use on ECG data:

    +
    adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
    +
    +ecg_meta <-tibble::tribble(
    +    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    +    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    +    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    +    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    +    "studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    +    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    +    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    +    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    +    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    +) %>% mutate(
    +    col_key = text_key,
    +    type="column"
    +)
    +
    +qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    +qtOutliers$label <- "QT Outlier explorer"
    +qtOutliers$domain <- "custom_ecg"
    +qtOutliers$meta <- ecg_meta
    +
    +safetyGraphicsApp(
    +    domainData=list(custom_ecg=adeg), 
    +    charts=list(qtOutliers)
    +)
    +

    As of safetyGraphics v2.1, metadata can be saved directly to the chart object using chart$meta as shown in the example above.
    +Alternatively, metadata can be saved as a data object in the chart$package namespace. Chart-specific metadata should be saved as meta_{chart$name} while domain-level metadata should be named meta_{chart$domain}. It’s fine to use a combination of these approaches as appropriate for your chart. See ?safetyGraphics::makeMeta for more detail.

    +
    +
    +

    Appendix #1 - Chart Framework Technical Specifications +

    +
    +

    Configuration Overview +

    +

    +

    The diagram above summarizes the various components of the safetyGraphics charting framework:

    +
      +
    • The safetyGraphicsApp() function allows users to specify which charts to include in the shiny app via the charts parameter, which expects a list of charts.
    • +
    • Each item in charts is itself defined as a list that provides configuration details for a single chart. These configuration lists have several required parameters, which are described in the technical specification below.
    • +
    • Configuration lists are typically saved as YAML files, but can be also be loaded directly as list objects as shown in the Hello World example above.
    • +
    • Needed functions are bound to the chart object via the prepareChart() function. See the documentation for chart$functions below for full details.
    • +
    +
    +
    +

    Chart Specification +

    +

    Each item in the charts list should be a list() with the following parameters:

    +
      +
    • +env: Environment for the chart. Must be set to “safetyGraphics” or the chart is dropped. Type: character. Required +
    • +
    • +name: Name of the chart. Type: character. Required +
    • +
    • +type:: Type of chart. Valid options are: “plot”,“htmlwidget”,“html”,“table” and “module”. Type: character. Required +
    • +
    • +label: A short description of the chart. chart$name is used if not provided. Type: character. Optional +
    • +
    • +domain: The data domain(s) used in the chart. Type: character. Required +
    • +
    • +package: The package where the {htmlwidget} is saved. Type: character. Required when chart$type is “htmlwidget”
    • +
    • +meta: Table of chart-specific metadata. Metadata can also be saved as {package}::meta_{chart} or {package::meta_{domain}. See ?safetyGraphics::makeMeta for more detail.
    • +
    • +order: Order in which to display the chart. If order is a negative number, the chart is dropped. Defaults to 999999. Type: Integer. Optional +
    • +
    • +links: Named list of link names/urls to be shown in the chart header. Type: list of character. Optional +
    • +
    • +path: Full path of the YAML file. Auto-generated by makeChartConfig() Type: character optional +
    • +
    • +workflow: Names of functions used to create the chart. Should be loaded in global environment or included in chart$package before calling prepareChart(). Supported parameters are listed below. Type: list of character. Required +
        +
      • +workflow$main: name of the function to draw the chart. The function should take data and settings parameters unless the input parameters are customized by an init function. Required, unless chart$type is “htmlwidget” or “module”)
      • +
      • +workflow$init: name of initialization function that runs before chart is drawn via themainfunction. Should takedataandsettingsas input and return a list of parameters accepted by themain` function. Optional +
      • +
      • +workflow$widget: name or widget saved in chart$package to be passed to htmlwidgets::createWidget Required when chart$type is “htmlwidget”
      • +
      • +workflow$ui and workflow$server: names of functions to render shiny ui and server. Automatically generated in prepareChart() unless chart$type is “module”. Required when chart$type is ‘module’
      • +
      +
    • +
    • +functions: a list of functions used to create the chart. Typically generated at runtime by prepareChart() using information in chart$workflow, chart$type and chart$package. Not recommended to generate manually. Type: list of functions. Required +
    • +
    +
    +
    +

    Default Technical workflow +

    +

    This appendix describe the technical process used to render a chart when safetyGraphicsApp() is called with the default parameters.

    +
      +
    1. +safetyGraphicsApp() is called with charts and chartSettingsPath as NULL (the default).
    2. +
    3. +app_startup is called, which then immediately calls makeChartConfig().
    4. +
    5. +makeChartConfig() looks for charts in the safetyCharts package (the default) since no path was specified. The function looks for the package in all current .libPaths() and then looks in the inst/config folder once the package is found.
    6. +
    7. +makeChartConfig loads YAML configuration files in the specified directories and saves them to a list. name and path parameters are added.
    8. +
    9. +makeChartConfig calls prepareChart for each chart configuration. prepareChart sets default values for order, name and export, and then binds relevant functions to a chart$functions list based on the chart’s type, workflow and package.
    10. +
    11. That list of charts is then returned to app_startup() which runs a few actions on each chart: +
        +
      • If chart$functions is missing, prepareChart is called (not relevant in the default workflow, but useful for adding custom charts)
      • +
      • If chart$order is negative, the chart is dropped with a message.
      • +
      • If chart$env is not “safetyGraphics”, the chart is dropped with a message.
      • +
      • If chart$domains has elements not found in the dataDomains passed to `app_startup(), the chart is dropped with a message.
      • +
      • +charts are re-ordered based on chart$order +
      • +
      +
    12. +
    13. +app_startup passes the updated list of charts to makeMeta assuming no meta object was provided. makeMeta combines metadata from all charts in to a single data.frame. Charts can save metadata as chart.meta, {package}::meta_{chart} or {package}::meta_{domain}.
    14. +
    15. +app_startup returns the list of charts and associated metadata to safetyGraphicsApp which then then passes them along to safetyGraphicsServer as the charts parameter.
    16. +
    17. +safetyGraphicsServer then creates modules for each chart. First, UIs are created via chartsNav() which then calls: +
        +
      • +makeChartSummary to create the chart header with links and metadata and …
      • +
      • +ChartsTabUI which then calls chart$functions$ui to create the proper UI element based on chart$type.
      • +
      +
    18. +
    19. Next, safetyGraphicsServer draws the charts using chartsTab() which: +
        +
      • Creates a reactive params object containing mappings and data using makeChartParams() which: +
          +
        • Subsets domainData based on chart$domain +
        • +
        • Calls charts$functions$init if provided
        • +
        • Does custom formatting for chart$type of “htmlwidget”
        • +
        +
      • +
      • Chart is drawn using chart$functions$server and chart$functions$main +
      • +
      • Button to download R script is added to header. Script is created by makeChartExport() +
      • +
      • Button to download html report is added to header unless type=“module”. Report template is at “inst/reports/safetyGraphicsReport.Rmd”
      • +
      +
    20. +
    21. Finally, safetyGraphicsServer passes the charts to settingsTab, which uses them to help populate the charts and code subtabs.
    22. +
    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.2.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/Cookbook.html b/docs/articles/Cookbook.html new file mode 100644 index 00000000..c6258a2b --- /dev/null +++ b/docs/articles/Cookbook.html @@ -0,0 +1,390 @@ + + + + + + + +Cookbook • safetyGraphics + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Cookbook Vignette +

    +

    This vignette contains a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios.

    +
    +
    +

    Overview +

    +

    Most of the customization shown here is done by changing 4 key parameters in the safetyGraphicsApp() function:

    +
      +
    • +domainData – Domain-level Study Data
    • +
    • +mapping – List identifying the key columns/fields in your data
    • +
    • +charts – Define the charts used in the app.
    • +
    • +meta – Metadata table with info about required columns and fields
    • +
    +

    domainData and mapping generally change for every study, while charts and meta can generally be re-used across many studies.

    +

    The examples here are generally provided with minimal explanation. For a more detailed discussion of the logic behind these examples see the Chart Configuration Vignette or our 2021 R/Pharma Workshop

    +
    +
    +

    Setup and installation +

    +

    safetyGraphics requires R v4 or higher. These examples have been tested using RStudio v1.4, but should work on other platforms with proper configuration.

    +

    You can install safetyGraphics from CRAN like any other R package:

    +
    install.packages("safetyGraphics")
    +library("safetyGraphics")
    +

    Or to use the most recent development version from GitHub, call:

    +
    devtools::install_github("safetyGraphics/safetyCharts", ref="dev")
    +library(safetyCharts)
    +devtools::install_github("safetyGraphics/safetyGraphics", ref="dev")
    +library(safetyGraphics)
    +safetyGraphics::safetyGraphicsApp()
    +
    +

    Example 1 - Default App +

    +

    To run the app with no customizations using sample AdAM data from the {safetyData} package, install the package and run:

    +
    safetyGraphics::safetyGraphicsApp()
    +
    +
    +
    +

    Loading Custom Data +

    +

    The next several examples focus on study-specific customizations for loading and mapping data.

    +
    +

    Example 2 - SDTM Data +

    +

    The data passed in to the safetyGraphics app can be customized using the domainData parameter in safetyGraphicsApp(). For example, to run the app with SDTM data saved in {safetyData}, call:

    +
    sdtm <- list(
    +    dm=safetyData::sdtm_dm,
    +    aes=safetyData::sdtm_ae,
    +    labs=safetyData::sdtm_lb
    +)
    +
    +safetyGraphics::safetyGraphicsApp(domainData=sdtm)
    +
    +
    +

    Example 3 - Single Data Domain +

    +

    Running the app for a single data domain, is similar:

    +
    justLabs <- list(labs=safetyData::adam_adlbc)
    +safetyGraphics::safetyGraphicsApp(domainData=justLabs)
    +

    Note that charts with missing data are automatically dropped and the filtering tab is not present since it requires demographics data by default.

    +
    +
    +

    Example 4 - Loading other data formats +

    +

    Users can also import data from a wide-variety of data formats using standard R workflows and then initialize the app. The example below initializes the app using lab data saved as a sas transport file (.xpt)

    +
    xptLabs <- haven::read_xpt('https://github.com/phuse-org/phuse-scripts/blob/master/data/adam/cdiscpilot01/adlbc.xpt?raw=true')
    +safetyGraphics::safetyGraphicsApp(domainData=list(labs=xptLabs))
    +
    +
    +

    Example 5 - Non-standard data +

    +

    Next, let’s initialize the the app with non-standard data. {safetyGraphics} automatically detects AdAM and SDTM data when possible, but for non-standard data, the user must provide a data mapping. This can be done in the app using the data/mapping tab, or can be done when the app is initialized by passing a mapping list to safetyGraphicsApp(). For example:

    +
    notAdAM <- list(labs=safetyData::adam_adlbc %>% rename(id = USUBJID))
    +idMapping<- list(labs=list(id_col="id"))
    +safetyGraphicsApp(domainData=notAdAM, mapping=idMapping)
    +
    +
    +

    Example 6 - Non-standard data #2 +

    +

    For a more realistic example, consider this labs data set (csv). The data can be loaded in to safetyGraphics with the code below, but several items in the mapping page need to be filled in:

    +
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    +safetyGraphics::safetyGraphicsApp(domainData=list(labs=labs))
    +

    drawing

    +

    Fortunately there is no need to re-enter this mapping information in every time you re-start the app. After filling in these values once, you can export code to restart the app with the specified settings pre-populated. First, click on the setting icon in the header and then on “code” to see this page:

    +

    +

    The YAML code provided here captures the updates you’ve made on the mapping page. To re-start the app with those settings, just save these YAML code in a new file called customSettings.yaml in your working directory, and then call:

    +
    labs <- read.csv("https://raw.githubusercontent.com/SafetyGraphics/SafetyGraphics.github.io/master/pilot/SampleData_NoStandard.csv")
    +customMapping <- read_yaml("customSettings.yaml")
    +safetyGraphics::safetyGraphicsApp(
    +    domainData=list(labs=labs),
    +    mapping=customMapping   
    +)
    +

    Note, that for more complex customizations, the setting page also provides a .zip file with a fully re-usable version of the app.

    +
    +
    +
    +

    Custom Charts +

    +

    The remaining examples focus on creating charts that are reusable across many studies. For extensive details on adding and customizing different types of charts, see this vignette.

    +
    +

    Example 7 - Drop Unwanted Charts +

    +

    Users can also generate a list of charts and then drop charts that they don’t want to include. For example, if you wanted to drop charts with type of “htmlwidgets” you could run this code.

    +
    library(purrr)
    +charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    +notWidgets <- charts %>% purrr::keep(~.x$type != "htmlwidget")
    +safetyGraphicsApp(charts=notWidgets)
    +
    +
    +

    Example 8 - Edit Default Charts +

    +

    Users can also make modifications to the default charts by editing the list of charts directly.

    +
    charts <- makeChartConfig() #gets charts from safetyCharts pacakge by default
    +charts$aeTimelines$label <- "An AMAZING timeline"
    +safetyGraphicsApp(charts=charts)
    +
    +
    +

    Example 9 - Add Hello World Custom Chart +

    +

    This example creates a simple “hello world” chart that is not linked to the data or mapping loaded in the app.

    +
    helloWorld <- function(data, settings){
    +    plot(-1:1, -1:1)
    +    text(runif(20, -1,1),runif(20, -1,1),"Hello World")
    +}
    +
    +# Chart Configuration
    +helloworld_chart<-list(
    +    env="safetyGraphics",
    +    name="HelloWorld",
    +    label="Hello World!",
    +    type="plot",
    +    domain="aes",
    +    workflow=list(
    +        main="helloWorld"
    +    )
    +)
    +
    +safetyGraphicsApp(charts=list(helloworld_chart))
    +
    +
    +

    Example 10 - Add a custom chart using data and settings +

    +

    The code below adds a new simple chart showing participants’ age distribution by sex.

    +
    ageDist <- function(data, settings){
    +    p<-ggplot(data = data, aes(x=.data[[settings$age_col]])) +
    +        geom_histogram() + 
    +        facet_wrap(settings$sex_col)
    +    return(p)
    +}
    +
    +ageDist_chart<-list(
    +    env="safetyGraphics",
    +    name="ageDist",
    +    label="Age Distribution",
    +    type="plot",
    +    domain="dm",
    +    workflow=list(
    +        main="ageDist"
    +    )
    +)
    +charts <- makeChartConfig() 
    +charts$ageDist<-ageDist_chart
    +safetyGraphicsApp(charts=charts)
    +
    +
    +

    Example 11 - Create a Hello World Data Domain and Chart +

    +

    Here we extend example 9 to include the creating of a new data domain with custom metadata, which is bound to the chart object as chart$meta. See ?makeMeta for more detail about the creation of custom metadata.

    +
    helloMeta <- tribble(
    +    ~text_key, ~domain, ~label,       ~standard_hello, ~description,
    +    "x_col",   "hello", "x position", "x",             "x position for points in hello world chart",   
    +    "y_col",   "hello", "y position", "y",             "y position for points in hello world chart"   
    +) %>% mutate(
    +    col_key = text_key,
    +    type="column"
    +)
    +
    +helloData<-data.frame(x=runif(50, -1,1), y=runif(50, -1,1))
    +
    +helloWorld <- function(data, settings){
    +    plot(-1:1, -1:1)
    +    text(data[[settings$x_col]], data[[settings$y_col]], "Custom Hello Domain!")
    +}
    +
    +helloChart<-prepareChart(
    +    list(
    +        env="safetyGraphics",
    +        name="HelloWorld",
    +        label="Hello World!",
    +        type="plot",
    +        domain="hello",
    +        workflow=list(
    +            main="helloWorld"
    +        ), 
    +        meta=helloMeta
    +    )
    +)
    +
    +charts <- makeChartConfig()
    +charts$hello <- helloChart #Easy to combine default and custom charts
    +data<-list(
    +    labs=safetyData::adam_adlbc, 
    +    aes=safetyData::adam_adae, 
    +    dm=safetyData::adam_adsl,
    +    hello=helloData
    +)
    +
    +#no need to specify meta since safetyGraphics::makeMeta() will generate the correct list by default. 
    +safetyGraphicsApp(
    +    domainData=data, 
    +    charts=charts
    +)
    +
    +
    +

    Example 13 - Create an ECG Data Domain & Chart +

    +

    This example defines a custom ECG data domain and adapts an existing chart for usage there. See this PR for a full implementation of the ECG domain in safetyCharts.

    +
    adeg <- readr::read_csv("https://physionet.org/files/ecgcipa/1.0.0/adeg.csv?download")
    +
    +ecg_meta <-tibble::tribble(
    +    ~text_key, ~domain,                      ~label,                               ~description, ~standard_adam, ~standard_sdtm,
    +    "id_col",   "custom_ecg",                 "ID column", "Unique subject identifier variable name.",      "USUBJID",      "USUBJID",
    +    "value_col",   "custom_ecg",              "Value column",                 "QT result variable name.",         "AVAL",     "EGSTRESN",
    +    "measure_col",   "custom_ecg",            "Measure column",                 "QT measure variable name",        "PARAM",       "EGTEST",
    +"studyday_col",   "custom_ecg",          "Study Day column",                  "Visit day variable name",          "ADY",         "EGDY",
    +    "visit_col",   "custom_ecg",              "Visit column",                      "Visit variable name",         "ATPT",        "EGTPT",
    +    "visitn_col",   "custom_ecg",       "Visit number column",               "Visit number variable name",        "ATPTN",             NA,
    +    "period_col",   "custom_ecg",             "Period column",                     "Period variable name",      "APERIOD",             NA,
    +    "unit_col",   "custom_ecg",               "Unit column",            "Unit of measure variable name",        "AVALU",     "EGSTRESU"
    +) %>% mutate(
    +    col_key = text_key,
    +    type="column"
    +)
    +
    +qtOutliers<-prepare_chart(read_yaml('https://raw.githubusercontent.com/SafetyGraphics/safetyCharts/dev/inst/config/safetyOutlierExplorer.yaml') )
    +qtOutliers$label <- "QT Outlier explorer"
    +qtOutliers$domain <- "custom_ecg"
    +qtOutliers$meta <- ecg_meta
    +
    +safetyGraphicsApp(
    +    meta=ecg_meta, 
    +    domainData=list(custom_ecg=adeg), 
    +    charts=list(qtOutliers)
    +)
    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.2.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/Intro.html b/docs/articles/Intro.html new file mode 100644 index 00000000..df464181 --- /dev/null +++ b/docs/articles/Intro.html @@ -0,0 +1,278 @@ + + + + + + + +Intro to Shiny App • safetyGraphics + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Intro Vignette +

    +

    The safetyGraphics shiny app provides an easy-to-use shiny interface for creating shareable safety graphics for any study. This vignette provides an overview of the app’s functionality, shows how to initialize the app with your own study data, and provides links to technical resources explaining how to customize the app.

    +
    +
    +

    safetyGraphics Demo +

    +

    A demo of shiny application using data from the {safetyData} package is hosted here. The app can also be initialized with the safetyGraphicsApp() function in the R console - see Appendix 1 for details.

    +

    Let’s take a quick look at the various pages in the app.

    +
    +

    Home Tab +

    +

    A home page has a basic overview of the app.

    +

    +
    +
    +

    Mapping Tab +

    +

    The Mapping tab is used to tell charts which data columns and fields to use for various chart components.

    +

    +

    This mapping process makes it easy to re-use charts across many different studies. You can see previews of the loaded data using the checkbox at the top of the page. The demo data has 3 data domains (labs, adverse events (aes) and demographics (dm)), but others can be added as well. The mapping tab is automatically filled in for common data standards, like the ADaM data shown here, but can also be filled in manually for non-standard data.

    +
    +
    +

    Filtering Tab +

    +

    The Filtering tab allows users to interactively select which participants to include in charts.

    +

    +

    This tab is created using the filter functionality included in the {datamods} package. Whenever data is filtered in this tab, those filtered data are used in all charts (across all data domains). Note that the number of participants selected is always shown in the upper right hand corner of the app.

    +
    +
    +

    Charts Tab +

    +

    Clicking the Charts tab opens a dropdown menu containing a series of charts related to clinical trial safety. Clicking the Hepatic Safety Explorer opens this page:

    +

    +

    safetyGraphics supports many different kinds of charts including web-based interactive graphics using {htmlwidgets} (like the chart shown above), static plots, plotly plots and custom shiny modules. Each chart has a header that provides details about the chart, links to chart-specific resources and buttons that allow users to download a stand-alone html report or a .R file that reproduces the chart. See the Chart Configuration Vignette for more detail about the safetyGraphics charting framework.

    +
    +
    +

    ⚙️ (Settings) Tab +

    +

    Finally, the Settings tab - shown as a gear icon ⚙️ - contains technical details that can be used to customize/troubleshoot the app. Clicking on the “Code” sub-tab (shown below) allows you to download a zip file that can be used to re-open the app with with any customizations that have been made during your current session.

    +

    +
    +
    +
    +

    Loading Study Data +

    +

    safetyGraphics supports a wide range of data formats and standards. Generally speaking, any clinical data can be loaded as long it meets the minimal data requirements described in appendix 2.

    +

    There are 2 primary ways to load your study data in to the safetyGraphics shiny app:

    +
      +
    1. Using safetyGraphicsInit() shiny interface
    2. +
    3. Passing data directly to safetyGraphicsApp() +
    4. +
    +
    +

    Loading data with safetyGraphicsInit() +

    +

    The safetyGraphicsInit() function starts a simple app that allows users to select charts and then load the data required via a point-and-click interface as shown below:

    +

    +

    The app dynamically determines which data sets are required for the selected charts and updates the “Data Loader” UI when the charts selection changes. Below, we’ve selected 2 charts from the labs domain - so the other data domains are automatically hidden.

    +

    +

    Once you’ve picked charts, click the “Load” buttons in the “Data Loader” section to select data files for each domain. Data is loaded using the import functionality from the {datamods} package which allows you to select data loaded in your R session or load data files directly from your file system. datamods supports any file format that {rio} can handle including text files, Excel, SAS and SPSS format.

    +

    Once you’ve loaded files for all of the active data domains, the “Run App” button will become active. Click it to initialize the app.

    +
    +
    +

    Passing data to safetyGraphicsApp() +

    +

    You can also initialize the app with custom data directly from the R console. The basic workflow is as follows:

    +
      +
    1. Load your data in to the R session
    2. +
    3. Save your data as a named list. The name of each list item should correspond to a safetyGraphics data domain.
    4. +
    5. Run safetyGraphicsApp() using the domainData to pass the list of data frames.
    6. +
    +

    Here is a simple example that starts the app with SDTM data from the safetyData library:

    +
    library(safetyData)
    +sdtm <- list(
    +    dm=safetyData::sdtm_dm,
    +    aes=safetyData::sdtm_ae,
    +    labs=safetyData::sdtm_lb
    +)
    +
    +safetyGraphics::safetyGraphicsApp(domainData=sdtm)
    +

    This example and other use cases are described in cookbook vignette.

    +
    +
    +

    Large Data sets +

    +

    Use the maxFileSize option to load data sets larger than 5 mb in safetyGraphicsInit (e.g. safetyGraphicsinit(maxFileSize=100)). safetyGraphicsApp() does not have size limits for data files, but note that large data (>100 mb) may cause performance issues.

    +
    +
    +
    +

    Additional Resources +

    +

    Several additional vignettes are available for more advanced topics:

    +
      +
    • +Chart Configuration Vignette - details about the charting process including technical specifications and step-by-step instructions
    • +
    • +Cookbook Vignette - a series of examples showing how to initialize the safetyGraphics Shiny app in different scenarios
    • +
    • +Technical FAQ Vignette - vignette discussing security, validation and other technical issues
    • +
    +

    The {safetyGraphics} app is maintained by the Interactive Safety Graphics (ISG) subteam of the ASA Biopharm-DIA Safety Working Group. You can learn more about the team and find links to recent presentations and publications at our home page.

    +
    +
    +

    Appendix 1 - Initialization code +

    +

    We suggest running the app in RStudio with R version 4.0 or higher. The following code installs the {safetyGraphics} package and initializes the app demo:

    +
    install.packages('safetyGraphics')
    +library(safetyGraphics)
    +safetyGraphicsApp()
    +

    Or to use the initialization workflow:

    +
    install.packages('safetyGraphics')
    +library(safetyGraphics)
    +safetyGraphicsInit()
    +

    Or you can install the most recent development version of {safetyGraphics} and the companion package {safetyCharts} directly from GitHub:

    +
    install.packages("devtools")
    +library(devtools)
    +devtools::install_github("safetyGraphics/safetyGraphics") 
    +library(safetyGraphics)
    +devtools::install_github("safetyGraphics/safetyCharts") 
    +library(safetyCharts)
    +safetyGraphicsApp() #or safetyGraphicsInit()
    +
    +
    +

    Appendix 2 - Minimum Data Requirements +

    +

    Since the safetyGraphics framework supports adding custom charts (that may have custom settings), there are no universal data requirements for the app. However, the charts included by default version of the app are built to share requirements whenever possible. These requirements are captured in an included metadata file called safetyGraphics::meta.

    +

    The most basic requirements for the 3 default domains are:

    +
      +
    • +Lab results (labs) domain - Expects one record per person per visit per lab measurement with columns for: Participant ID, lab result, lab name, lower limit of normal, upper limit of normal, study day, study visit (numeric), study visit (character). See safetyGraphics::meta %>% filter(domain=="labs") for additional details and optional columns used by some charts.
    • +
    • +Adverse Event (aes) domain - Expects one record per adverse event with columns for: Participant ID, AE Sequence, Study Day, AE Start day, AE end day, AE preferred term and AE body system. See safetyGraphics::meta %>% filter(domain=="aes") +
    • +
    • +Demographics (dm) domain - Expects one record per person with columns for: Participant ID, Sex, Race, Age and Study Treatment (optional) . See safetyGraphics::meta %>% filter(domain=="dm") for additional details.
    • +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.2.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/TechnicalFAQ.html b/docs/articles/TechnicalFAQ.html new file mode 100644 index 00000000..881e5c95 --- /dev/null +++ b/docs/articles/TechnicalFAQ.html @@ -0,0 +1,260 @@ + + + + + + + +Technical FAQ • safetyGraphics + + + + + + + + + + + + +
    +
    + + + + +
    +
    + + + + +
    +

    Technical FAQ Vignette +

    +

    This vignette answers frequently asked technical questions about {safetyGraphics}. It addressees questions on a variety of technical topics including Qualification and Validation status, Common Data Pipelines and Security.

    +

    Whenever new questions come in, we’ll update the version of this FAQ in our wiki - so check there first if you have a question. We’ll update the vignette on CRAN whenever a new version of the package is released.

    +
    +
    +

    Contributing +

    +
    +

    Q: Can I contribute code to the project? +

    +

    A: Yes. Check out our contributor guidelines. Feel free to follow-up with questions on the discussion board.

    +
    +
    +

    Q: Can I join the working group? +

    +

    A: Yes. Fill out this Google Form and we’ll get in touch.

    +
    +
    +
    +

    Validation, Quality Control and Testing +

    +
    +

    Q: Is the safetyGraphics package validated? +

    +

    A: As of the version 2 release, the safetyGraphics package is intended for exploratory use only and is not validated or qualified per 21 CFR Part 11. No warranty or guarantees are included as part of the package. Further, any formal validation should be fit for purpose and follow your organization’s procedures. That said, extensive quality checks are built in to the package (see the question below for details) and into many of charts that are included by default. The R Consortium has guidance on usage of R in Regulated Trials and we also follow the work of R Validation hub closely, and may release validation guidance based on the approach described in their white paper at a future date.

    +
    +
    +

    Q: Can I validate charts created by safetyGraphics? +

    +

    A: Study-specific instances of most safetyGraphics charts can be exported either as an R script or as a standalone html report. It may be possible to treat those outputs as standard TLFs (Tables, Listings and Figures) and conduct QC/Validation on them using standard statistical SOPs. Consult with your companies procedures to confirm.

    +
    +
    +

    Q: What testing/QC process for safetyGraphics? +

    +

    A: Several layers of quality control are included in our standard development workflow including: - Over 200 automated unit tests with testthat that run automatically via Continuous integration with GitHub actions. - Automated unit tests for shiny modules run via a headless browser using shinytest. - Pass all standard R checks in R cmd check - Full code review of all new functionality documented in GitHub PR. - Issue tracking in GitHub - Formal Alpha/Beta user testing before major releases - Basic user tests conducted before minor release

    +
    +
    +

    Q: Is the safetyGraphics app ready for “production” use? +

    +

    A: As of the v2 release, safetyGraphics is mostly used in an exploratory fashion for a variety of use cases. The details of a ‘production’ implementation of safetyGraphics in a GxP environment would largely be dictated the intended use of the tool. For example, using safetyGraphics as your primary safety oversight platform would likely require more work than using it as a supplemental exploratory tool for biostatisticians.

    +

    That said, the issues surrounding a ‘production’ deployment are mostly technical and operational at this point and could likely be overcome by a motivated organization with ample technical expertise. Some of the issues that would need to be addressed in a production deployment:

    +
      +
    • Qualification documentation (Organization-specific)
    • +
    • Formalized deployment pipeline for Shiny with proper authentication and security (Organization-specific)
    • +
    • App Maintenance model (Organization-specific)
    • +
    • Data pipeline for study set-up and customization (Organization-specific)
    • +
    • Issues with big data set performance in htmlwidget renderers
    • +
    +

    Many of these issues aren’t specific to safetyGraphics and may be easier to address for an organization that has experience using R and Shiny in production. As discussed above, there is a significant push towards using R for many aspects of clinical trials. We plan to keep safetyGraphics up to date with emerging best practices and will provide supporting documentation whenever possible.

    +

    Finally, it is worth noting “Productionize” and “Validate” are slightly different. Joe Cheng (the primary author of Shiny) has a nice talk on this topic from a software engineering perspective.

    +
    +
    +
    +

    Use Cases, Data Sources and Deployment +

    +
    +

    Q: I can see that the software has the MIT license, so does this essentially mean that any company would be free to use the software without restriction? +

    +

    A: Yes. The package is open source and free to use. Here’s a link to the license and a quick summary of how it works.

    +
    +
    +

    Q: What are some common use cases for safetyGraphics? +

    +

    A: safetyGraphics graphics has been used in a variety of ways. Some of the most common use cases thus far are: - Analysts exploring safety data - Clinicians monitoring ongoing studies - Analysts and Clinicians evaluating safety signals in completed studies

    +

    As an open source tool with a flexible data pipeline, many other use cases have been discussed: - Data review by Data Safety Monitoring Boards (link) - Visualizing Analysis results data (link) - Risk based monitoring

    +
    +
    +

    Q: Do I have to use a certain data standard with safetyGraphics? +

    +

    A: No. Any standard (or non-standard) data can be loaded as long as it meets the minimum data requirements for the selected data domain. Metadata capturing default CDISC standards are included with the app (see ?safetyGraphics::meta) so that data mappings can be automatically populated when AdAM and SDTM data are loaded. Other data standards require the user to manually complete the data mapping in the mapping tab - see the cookbook vignette for examples.

    +
    +
    +

    Q: What data sources does safetyGraphics support? How do I load custom data? +

    +

    A: This topic is covered in detail in the Loading data section of the Introductory vignette. safetyGraphics is designed to support a flexible data pipeline that supports many data types. In short, data can be loaded using the dataDomains parameter in the safetyGraphicsApp() function or via the safetyGraphicsInit() graphical user interface.

    +

    safetyGraphicsApp() - custom data can be loaded via the dataDomains parameter, which should be a list containing dataframes or tibbles for each clinical domain; that list can be populated by importing data from any number of sources including databases, sas files or any number of other sources. See the cookbook vignette for some basic examples of loading custom data.

    +

    safetyGraphicsInit() - allows users to load tabular data from a variety of sources using the point-and-click interface provided in the {datamods} package.

    +

    More detail is provided in the Loading data section of the Introductory vignette

    +
    +
    +

    Is data loaded in to the safetyGraphics app secure? +

    +

    Since the safetyGraphics app typically uses data subject to GxP regulations, data security is extremely important and should always be discussed with your organizations IT and regulatory departments before loading any study data in to the application. No warranty or guarantees are included as part of the package.

    +

    Just like the discussion regarding Validation and Quality Control, data security requirements are dictated by the intended use of the app and should be fit for purpose. There are many different ways to run shiny applications, and the security implications of each approach varies. For example, having statisticians run the app locally using R Studio is quite different than deploying the app on a service like shinyapps.io. This complexity is all the more reason to discuss with IT. There are many resources - related to data security for clinical trials in general (1, 2, 3) and discussing data security in shiny (4, 5) - that could help to facilitate these discussion.

    +
    +
    +

    Q: How can the safetyGraphics app be shared? +

    +

    A: The safetyGraphics app can be shared using standard shiny methodology. More details for specific use cases are given in the next few questions. Charts created by safetyGraphics can also be exported and re-used. Charts created with htmlwidgets are especially flexible and can be used in many contexts - including in web applications outside of R.

    +
    +
    +

    Q: Do you recommend deploying the app to a dedicated server for internal usage? +

    +

    A: It depends a bit on your use-case and how the app is hosted. For example, analysts using the data in an exploratory fashion can probably just run it from RStudio, but if multiple medical monitors using the app for medical monitoring in active studies probably need a more robust (and possibly validated) set up using Shiny Server, RStudio Connect or something similar.

    +
    +
    +

    Q: Can I deploy safetyGraphics to shinyapps.io to explore trial data from my organization? +

    +

    A: We advise against loading non-authorized, private, or non-deidentified patient data outside of your organization’s firewall. Consult with your IT and QA first. There is huge risk associated with confidentiality, IP, and patient privacy. Also refer to ShinyApps.io Chapter 8 Security and Compliance.

    +
    +
    +

    +Q: Can I deploy safetyGraphics to an internal RStudio Connect server? +

    +

    A: Yes. The script below should be easy to deploy via the RStudio interface or by running rsconnect::deployApp() and can easily be customized to support custom data and charts.

    +
    # Launch the ShinyApp (Do not remove this comment)
    +library(safetyGraphics) 
    +safetyGraphics::safetyGraphicsApp(runNow = FALSE)
    +
    +
    +
    +

    Misc. +

    +
    +

    Q: How do I avoid R not choking on the huge volume of lab data? (from @AlbrechtDurer) +

    +

    A: Several of the JavaScript charts build using htmlwidgets do have performance issues with very large data sets. Focusing on specific toxicities helps, but probably isn’t enough for really big studies. In those cases, I think the most important thing is to design a your data pipeline to include both a database backend (as opposed to loading all of your study data each time you initialize the app) and visualizations that summarize the data in a reasonable way (as opposed to just plotting every single data point in a scatter plot no matter what). Fortunately this is all doable in R, and improvements in this area are on our road map for future releases of safetyGraphics.

    +
    +
    +
    + + + +
    + + + +
    + +
    +

    +

    Site built with pkgdown 2.0.2.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/articles/index.html b/docs/articles/index.html new file mode 100644 index 00000000..43fa36e1 --- /dev/null +++ b/docs/articles/index.html @@ -0,0 +1,107 @@ + +Articles • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    All vignettes

    +

    + +
    Chart Configuration
    +
    +
    Cookbook
    +
    +
    Intro to Shiny App
    +
    +
    Technical FAQ
    +
    +
    +
    +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 00000000..a04e7640 --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,143 @@ + +Authors and Citation • safetyGraphics + + +
    +
    + + + +
    +
    +
    + + + +
    • +

      Jeremy Wildfire. Maintainer, author. +

      +
    • +
    • +

      Becca Krouse. Author. +

      +
    • +
    • +

      Preston Burns. Author. +

      +
    • +
    • +

      Xiao Ni. Author. +

      +
    • +
    • +

      James Buchanan. Author. +

      +
    • +
    • +

      Susan Duke. Author. +

      +
    • +
    +
    +
    +

    Citation

    + Source: DESCRIPTION +
    +
    + + +

    Wildfire J, Krouse B, Burns P, Ni X, Buchanan J, Duke S (2022). +safetyGraphics: Interactive Graphics for Monitoring Clinical Trial Safety. +R package version 2.1.0, https://github.com/SafetyGraphics/safetyGraphics. +

    +
    @Manual{,
    +  title = {safetyGraphics: Interactive Graphics for Monitoring Clinical Trial Safety},
    +  author = {Jeremy Wildfire and Becca Krouse and Preston Burns and Xiao Ni and James Buchanan and Susan Duke},
    +  year = {2022},
    +  note = {R package version 2.1.0},
    +  url = {https://github.com/SafetyGraphics/safetyGraphics},
    +}
    + +
    + +
    + + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 00000000..5a859415 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 00000000..1cdd573b --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 00000000..e5f1fe1d --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 00000000..b35504cd --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..99eb9706 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,187 @@ + + + + + + + +Interactive Graphics for Monitoring Clinical Trial Safety • safetyGraphics + + + + + + + + + + + + +
    +
    + + + + +
    +
    + +

    R build status

    +
    + +

    The {safetyGraphics} package provides a framework for evaluating of clinical trial safety in R using a flexible data pipeline. The package includes a shiny application that allows users to explore safety data using a series of interactive graphics, including the hepatic safety explorer shown below. The package has been developed as part of the Interactive Safety Graphics (ISG) workstream of the ASA Biopharm-DIA Safety Working Group.

    +
    +

    edishgif

    +
    +
    +

    Using the app +

    +

    A demo of the app using sample data is available here or can be initialized as follows:

    +
    +install.packages("safetyGraphics")
    +library("safetyGraphics")
    +safetyGraphicsApp() #open the shiny application
    +

    The most common workflow is for a user to initialize the app with their data, adjust settings as needed, and view the interactive charts. Finally, the user can share any chart by exporting its source code or by generating a self-contained, fully reproducible report that can be shared with others.

    +

    Instructions for loading study data are provided in the introductory vignette and more complex customizations are provided in the cookbook vignette.

    +
    +
    +
    +

    Charts +

    +

    The app is built to support a wide variety of chart types including static plots (e.g. from {ggplot2}), shiny modules, {htmlwidgets} and even static outputs like RTFs. Several pre-configured charts are included in the companion {safetyCharts} R Package, and are available by default in the app. Other charts can be added using the process descibed in this vignette.

    +
    + +
    + + +
    + + +
    + +
    +

    +

    Site built with pkgdown 2.0.2.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/link.svg b/docs/link.svg new file mode 100644 index 00000000..88ad8276 --- /dev/null +++ b/docs/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/docs/news/index.html b/docs/news/index.html new file mode 100644 index 00000000..cc8e0cd7 --- /dev/null +++ b/docs/news/index.html @@ -0,0 +1,130 @@ + +Changelog • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    + +

    This release focuses on updates the safetyGraphics metadata framework:

    +
    • The default metadata table has been migrated to safetyCharts and modularized. In short,safetyGraphics::meta is now saved as safetyCharts::meta_aes, safetyCharts::meta_labs and safetyCharts::meta_dm.
    • +
    • A new makeMeta function has been created and integrated in to the default workflow for the Shiny app. makeMeta provides a much more flexible framework for creating and storing metadata. See ?makeMeta and the Cookbook and Chart Configuration vignettes for more details.
    • +
    +
    + +

    Version 2 of {safetyGraphics} is a major update that adds the following features:

    +
    • Added support for multiple data domains
    • +
    • Streamlined support for multiple chart types
    • +
    • Improved chart export and newly added full-app export
    • +
    • Single filtering module for all charts
    • +
    • New “Config” tab summarizing app configuration
    • +
    • Created new safetyGraphicsInit() app with a simple UI that can initialize the app with custom data/charts
    • +

    For more details, see the fully updated vignettes.

    +
    +
    + +

    Allows users to preload their own charts and data sets for use in the safetyGraphics Shiny Application. See the “Custom Workflows” Vignette for details and examples.

    +
    +
    + +

    The first production release of safetyGraphics includes many improvements including the addition of 5 new interactive graphics and an embedded help page with a detailed clinical workflow for using the tool.

    +
    +
    + +

    Initial CRAN release for safetyGraphics. The safetyGraphics package provides framework for evaluation of clinical trial safety. Users can interactively explore their data using the ‘Shiny’ application or create standalone ‘htmlwidget’ charts. Interactive charts are built using ‘d3.js’ and ‘webcharts.js’ ‘JavaScript’ libraries.

    +

    See the GitHub release tracker for additional release documentation and links to issues.

    +
    +
    + + + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 00000000..80ea5b83 --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,384 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Ensure in-page images don't run outside their container */ +.contents img { + max-width: 100%; + height: auto; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + display: none; + margin-left: 5px; + width: 20px; + height: 20px; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 00000000..6f0eee40 --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $("div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 00000000..95a887a3 --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,13 @@ +pandoc: 2.11.4 +pkgdown: 2.0.2 +pkgdown_sha: ~ +articles: + ChartConfiguration: ChartConfiguration.html + Cookbook: Cookbook.html + Intro: Intro.html + TechnicalFAQ: TechnicalFAQ.html +last_built: 2022-04-08T09:33Z +urls: + reference: https://safetygraphics.github.io/safetyGraphics/reference + article: https://safetygraphics.github.io/safetyGraphics/articles + diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 0000000000000000000000000000000000000000..17a358060aed2a86950757bbd25c6f92c08c458f GIT binary patch literal 1011 zcmeAS@N?(olHy`uVBq!ia0y~yV0-|=9Be?5+AI5}0x7m6Z+90U4Fo@(ch>_c&H|6f zVg?3oArNM~bhqvg0|WD9PZ!6KiaBo&GBN^{G%5UFpXcEKVvd5*5Eu=C0SJK)8A6*F U7`aXvEC5;V>FVdQ&MBb@00SN#Z2$lO literal 0 HcmV?d00001 diff --git a/docs/reference/SafetyGraphics.html b/docs/reference/SafetyGraphics.html new file mode 100644 index 00000000..9cef77b4 --- /dev/null +++ b/docs/reference/SafetyGraphics.html @@ -0,0 +1,111 @@ + +safetyGraphics package — SafetyGraphics • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Create Interactive Graphics Related to Clinical Trial Safety

    +
    + + +
    +

    Details

    +

    Learn more on +CRAN +or GitHub

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/app_startup.html b/docs/reference/app_startup.html new file mode 100644 index 00000000..36dcea48 --- /dev/null +++ b/docs/reference/app_startup.html @@ -0,0 +1,141 @@ + +Startup code for shiny app — app_startup • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Prepare inputs for safetyGraphics app - run before app is initialized.

    +
    + +
    +
    app_startup(
    +  domainData = NULL,
    +  meta = NULL,
    +  charts = NULL,
    +  mapping = NULL,
    +  autoMapping = NULL,
    +  filterDomain = NULL,
    +  chartSettingsPaths = NULL
    +)
    +
    + +
    +

    Arguments

    +
    domainData
    +

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    +
    meta
    +

    data frame containing the metadata for use in the app. If no metadata is provided (default value is NULL), metatdata is generated by makeMeta().

    +
    charts
    +

    list of charts in the format produced by safetyGraphics::makeChartConfig()

    +
    mapping
    +

    list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    +
    autoMapping
    +

    boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the mapping parameter overwrite automatically generated mappings when both are found. Defaults to true.

    +
    filterDomain
    +

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    +
    chartSettingsPaths
    +

    path(s) where customization functions are saved relative to your working directory. All charts can have initialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.

    +
    +
    +

    Value

    +

    List of elements for used to initialize the shiny app with the following parameters

    • "meta" List of configuration metadata

    • +
    • "charts" List of charts

    • +
    • "domainData" List of domain level data sets

    • +
    • "mapping" Initial Data Mapping

    • +
    • "standards" List of domain level data standards

    • +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/chartsNav.html b/docs/reference/chartsNav.html new file mode 100644 index 00000000..5cde768e --- /dev/null +++ b/docs/reference/chartsNav.html @@ -0,0 +1,115 @@ + +Adds a navbar tab that initializes the Chart Module UI — chartsNav • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Adds a navbar tab that initializes the Chart Module UI

    +
    + +
    +
    chartsNav(chart, ns)
    +
    + +
    +

    Arguments

    +
    chart
    +

    chart metadata

    +
    ns
    +

    namespace

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/chartsTab.html b/docs/reference/chartsTab.html new file mode 100644 index 00000000..f2e85631 --- /dev/null +++ b/docs/reference/chartsTab.html @@ -0,0 +1,123 @@ + +Server for chart module, designed to be re-used for each chart generated. — chartsTab • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for chart module, designed to be re-used for each chart generated.

    +
    + +
    +
    chartsTab(input, output, session, chart, data, mapping)
    +
    + +
    +

    Arguments

    +
    input
    +

    Input objects from module namespace

    +
    output
    +

    Output objects from module namespace

    +
    session
    +

    An environment that can be used to access information and functionality relating to the session

    +
    chart
    +

    list containing a safetyGraphics chart object like those returned by makeChartConfig.

    +
    data
    +

    named list of current data sets (Reactive).

    +
    mapping
    +

    tibble capturing the current data mappings (Reactive).

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/chartsTabUI.html b/docs/reference/chartsTabUI.html new file mode 100644 index 00000000..3419e23c --- /dev/null +++ b/docs/reference/chartsTabUI.html @@ -0,0 +1,115 @@ + +UI for chart module, designed to be re-used for each chart generated. — chartsTabUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for chart module, designed to be re-used for each chart generated.

    +
    + +
    +
    chartsTabUI(id, chart)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    chart
    +

    list containing chart specifications like those returned by makeChartConfig.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/detectStandard.html b/docs/reference/detectStandard.html new file mode 100644 index 00000000..fcfe1e30 --- /dev/null +++ b/docs/reference/detectStandard.html @@ -0,0 +1,337 @@ + +Detect the data standard used for a data set — detectStandard • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    This function attempts to detect the clinical data standard used in a given R data frame.

    +
    + +
    +
    detectStandard(data, domain = NULL, meta = NULL)
    +
    + +
    +

    Arguments

    +
    data
    +

    A data frame in which to detect the data standard - required.

    +
    domain
    +

    the domain to evaluate - should match a value of meta$domain. Uses the first value in meta$domain if no value is provided.

    +
    meta
    +

    the metadata containing the data standards.

    +
    +
    +

    Value

    +

    A data frame describing the detected standard for each "text_key" in the provided metadata. Columns are "domain", "text_key", "column" and "standard".

    +
    +
    +

    Details

    +

    This function compares the columns in the provided "data" with the required columns for a given data standard/domain combination. The function is designed to work with the SDTM and ADaM CDISC(https://www.cdisc.org/) standards for clinical trial data by default. Additional standards can be added by modifying the "meta" data set included as part of this package.

    +
    + +
    +

    Examples

    +
    detectStandard(data=safetyData::adam_adae, meta=safetyCharts::meta_aes) 
    +#> $details
    +#> $details$adam
    +#> $details$adam$standard
    +#> [1] "adam"
    +#> 
    +#> $details$adam$mapping
    +#> # A tibble: 8 × 3
    +#> # Rowwise: 
    +#>   text_key     current  valid
    +#>   <chr>        <chr>    <lgl>
    +#> 1 id_col       USUBJID  TRUE 
    +#> 2 seq_col      AESEQ    TRUE 
    +#> 3 stdy_col     ASTDY    TRUE 
    +#> 4 endy_col     AENDY    TRUE 
    +#> 5 term_col     AEDECOD  TRUE 
    +#> 6 bodsys_col   AEBODSYS TRUE 
    +#> 7 severity_col AESEV    TRUE 
    +#> 8 serious_col  AESER    TRUE 
    +#> 
    +#> $details$adam$total_count
    +#> [1] 8
    +#> 
    +#> $details$adam$valid_count
    +#> [1] 8
    +#> 
    +#> $details$adam$invalid_count
    +#> [1] 0
    +#> 
    +#> $details$adam$match_percent
    +#> [1] 1
    +#> 
    +#> $details$adam$match
    +#> [1] "full"
    +#> 
    +#> $details$adam$label
    +#> [1] "ADaM"
    +#> 
    +#> 
    +#> $details$sdtm
    +#> $details$sdtm$standard
    +#> [1] "sdtm"
    +#> 
    +#> $details$sdtm$mapping
    +#> # A tibble: 8 × 3
    +#> # Rowwise: 
    +#>   text_key     current  valid
    +#>   <chr>        <chr>    <lgl>
    +#> 1 id_col       USUBJID  TRUE 
    +#> 2 seq_col      AESEQ    TRUE 
    +#> 3 stdy_col     NA       FALSE
    +#> 4 endy_col     NA       FALSE
    +#> 5 term_col     AEDECOD  TRUE 
    +#> 6 bodsys_col   AEBODSYS TRUE 
    +#> 7 severity_col AESEV    TRUE 
    +#> 8 serious_col  AESER    TRUE 
    +#> 
    +#> $details$sdtm$total_count
    +#> [1] 8
    +#> 
    +#> $details$sdtm$valid_count
    +#> [1] 6
    +#> 
    +#> $details$sdtm$invalid_count
    +#> [1] 2
    +#> 
    +#> $details$sdtm$match_percent
    +#> [1] 0.75
    +#> 
    +#> $details$sdtm$match
    +#> [1] "partial"
    +#> 
    +#> $details$sdtm$label
    +#> [1] "Partial SDTM"
    +#> 
    +#> $details$sdtm$details
    +#> [1] "(6/8 cols/fields matched)"
    +#> 
    +#> 
    +#> 
    +#> $standard
    +#> [1] "adam"
    +#> 
    +#> $label
    +#> [1] "ADaM"
    +#> 
    +#> $standard_percent
    +#> [1] 1
    +#> 
    +#> $mapping
    +#> # A tibble: 8 × 3
    +#> # Rowwise: 
    +#>   text_key     current  valid
    +#>   <chr>        <chr>    <lgl>
    +#> 1 id_col       USUBJID  TRUE 
    +#> 2 seq_col      AESEQ    TRUE 
    +#> 3 stdy_col     ASTDY    TRUE 
    +#> 4 endy_col     AENDY    TRUE 
    +#> 5 term_col     AEDECOD  TRUE 
    +#> 6 bodsys_col   AEBODSYS TRUE 
    +#> 7 severity_col AESEV    TRUE 
    +#> 8 serious_col  AESER    TRUE 
    +#> 
    +detectStandard(data=safetyData::adam_adlbc,meta=safetyCharts::meta_labs, domain="labs" ) 
    +#> $details
    +#> $details$adam
    +#> $details$adam$standard
    +#> [1] "adam"
    +#> 
    +#> $details$adam$mapping
    +#> # A tibble: 8 × 3
    +#> # Rowwise: 
    +#>   text_key        current  valid
    +#>   <chr>           <chr>    <lgl>
    +#> 1 id_col          USUBJID  TRUE 
    +#> 2 value_col       AVAL     TRUE 
    +#> 3 measure_col     PARAM    TRUE 
    +#> 4 normal_col_low  A1LO     TRUE 
    +#> 5 normal_col_high A1HI     TRUE 
    +#> 6 studyday_col    ADY      TRUE 
    +#> 7 visit_col       VISIT    TRUE 
    +#> 8 visitn_col      VISITNUM TRUE 
    +#> 
    +#> $details$adam$total_count
    +#> [1] 8
    +#> 
    +#> $details$adam$valid_count
    +#> [1] 8
    +#> 
    +#> $details$adam$invalid_count
    +#> [1] 0
    +#> 
    +#> $details$adam$match_percent
    +#> [1] 1
    +#> 
    +#> $details$adam$match
    +#> [1] "full"
    +#> 
    +#> $details$adam$label
    +#> [1] "ADaM"
    +#> 
    +#> 
    +#> $details$sdtm
    +#> $details$sdtm$standard
    +#> [1] "sdtm"
    +#> 
    +#> $details$sdtm$mapping
    +#> # A tibble: 9 × 3
    +#> # Rowwise: 
    +#>   text_key        current  valid
    +#>   <chr>           <chr>    <lgl>
    +#> 1 id_col          USUBJID  TRUE 
    +#> 2 value_col       LBSTRESN TRUE 
    +#> 3 measure_col     NA       FALSE
    +#> 4 normal_col_low  NA       FALSE
    +#> 5 normal_col_high NA       FALSE
    +#> 6 studyday_col    NA       FALSE
    +#> 7 visit_col       VISIT    TRUE 
    +#> 8 visitn_col      VISITNUM TRUE 
    +#> 9 unit_col        NA       FALSE
    +#> 
    +#> $details$sdtm$total_count
    +#> [1] 9
    +#> 
    +#> $details$sdtm$valid_count
    +#> [1] 4
    +#> 
    +#> $details$sdtm$invalid_count
    +#> [1] 5
    +#> 
    +#> $details$sdtm$match_percent
    +#> [1] 0.4444444
    +#> 
    +#> $details$sdtm$match
    +#> [1] "partial"
    +#> 
    +#> $details$sdtm$label
    +#> [1] "Partial SDTM"
    +#> 
    +#> $details$sdtm$details
    +#> [1] "(4/9 cols/fields matched)"
    +#> 
    +#> 
    +#> 
    +#> $standard
    +#> [1] "adam"
    +#> 
    +#> $label
    +#> [1] "ADaM"
    +#> 
    +#> $standard_percent
    +#> [1] 1
    +#> 
    +#> $mapping
    +#> # A tibble: 8 × 3
    +#> # Rowwise: 
    +#>   text_key        current  valid
    +#>   <chr>           <chr>    <lgl>
    +#> 1 id_col          USUBJID  TRUE 
    +#> 2 value_col       AVAL     TRUE 
    +#> 3 measure_col     PARAM    TRUE 
    +#> 4 normal_col_low  A1LO     TRUE 
    +#> 5 normal_col_high A1HI     TRUE 
    +#> 6 studyday_col    ADY      TRUE 
    +#> 7 visit_col       VISIT    TRUE 
    +#> 8 visitn_col      VISITNUM TRUE 
    +#> 
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/evaluateStandard.html b/docs/reference/evaluateStandard.html new file mode 100644 index 00000000..03daed4c --- /dev/null +++ b/docs/reference/evaluateStandard.html @@ -0,0 +1,217 @@ + +Evaluate a data set against a data standard — evaluateStandard • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Determines whether the required data elements in a data standard are found in a given data frame

    +
    + +
    +
    evaluateStandard(data, meta, domain, standard)
    +
    + +
    +

    Arguments

    +
    data
    +

    A data frame in which to detect the data standard

    +
    meta
    +

    the metadata containing the data standards.

    +
    domain
    +

    the domain to evaluate - should match a value of meta$domain

    +
    standard
    +

    standard to evaluate

    +
    +
    +

    Value

    +

    a list describing to what degree the data set matches the data standard. The "match" property describes compliance with the standard as "full", "partial" or "none". The "checks" property is a list of the data elements expected for the standard and whether they are "valid" in the given data set. "total_checks", "valid_checks" and "invalid_checks" provide counts of the specified checks. "match_percent" is calculated as valid_checks/total_checks. "mapping" is a data frame describing the detected standard for each "text_key" in the provided metadata. Columns are "text_key", "current" containing the name of the matched column or field value in the data and "match" a boolean indicating whether the data matches the standard.

    +
    + +
    +

    Examples

    +
    # Match is TRUE
    +evaluateStandard(
    + data=safetyData::adam_adlbc, 
    + meta=safetyCharts::meta_labs, 
    + domain="labs", 
    + standard="adam"
    +) 
    +#> $standard
    +#> [1] "adam"
    +#> 
    +#> $mapping
    +#> # A tibble: 8 × 3
    +#> # Rowwise: 
    +#>   text_key        current  valid
    +#>   <chr>           <chr>    <lgl>
    +#> 1 id_col          USUBJID  TRUE 
    +#> 2 value_col       AVAL     TRUE 
    +#> 3 measure_col     PARAM    TRUE 
    +#> 4 normal_col_low  A1LO     TRUE 
    +#> 5 normal_col_high A1HI     TRUE 
    +#> 6 studyday_col    ADY      TRUE 
    +#> 7 visit_col       VISIT    TRUE 
    +#> 8 visitn_col      VISITNUM TRUE 
    +#> 
    +#> $total_count
    +#> [1] 8
    +#> 
    +#> $valid_count
    +#> [1] 8
    +#> 
    +#> $invalid_count
    +#> [1] 0
    +#> 
    +#> $match_percent
    +#> [1] 1
    +#> 
    +#> $match
    +#> [1] "full"
    +#> 
    +#> $label
    +#> [1] "ADaM"
    +#> 
    +
    +# Match is FALSE
    +evaluateStandard(
    + data=safetyData::adam_adlbc, 
    + meta=safetyCharts::meta_labs, 
    + domain="labs", 
    + standard="sdtm"
    +) 
    +#> $standard
    +#> [1] "sdtm"
    +#> 
    +#> $mapping
    +#> # A tibble: 9 × 3
    +#> # Rowwise: 
    +#>   text_key        current  valid
    +#>   <chr>           <chr>    <lgl>
    +#> 1 id_col          USUBJID  TRUE 
    +#> 2 value_col       LBSTRESN TRUE 
    +#> 3 measure_col     NA       FALSE
    +#> 4 normal_col_low  NA       FALSE
    +#> 5 normal_col_high NA       FALSE
    +#> 6 studyday_col    NA       FALSE
    +#> 7 visit_col       VISIT    TRUE 
    +#> 8 visitn_col      VISITNUM TRUE 
    +#> 9 unit_col        NA       FALSE
    +#> 
    +#> $total_count
    +#> [1] 9
    +#> 
    +#> $valid_count
    +#> [1] 4
    +#> 
    +#> $invalid_count
    +#> [1] 5
    +#> 
    +#> $match_percent
    +#> [1] 0.4444444
    +#> 
    +#> $match
    +#> [1] "partial"
    +#> 
    +#> $label
    +#> [1] "Partial SDTM"
    +#> 
    +#> $details
    +#> [1] "(4/9 cols/fields matched)"
    +#> 
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/filterTab.html b/docs/reference/filterTab.html new file mode 100644 index 00000000..73b1e3a9 --- /dev/null +++ b/docs/reference/filterTab.html @@ -0,0 +1,140 @@ + +Server for the filter module in datamods::filter_data_ui — filterTab • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for the filter module in datamods::filter_data_ui

    +
    + +
    +
    filterTab(
    +  input,
    +  output,
    +  session,
    +  domainData,
    +  filterDomain,
    +  current_mapping,
    +  tabID = "Filtering",
    +  filterVars = NULL
    +)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    domainData
    +

    list of data files for each domain

    +
    filterDomain
    +

    domain to use for filtering (typically "dm")

    +
    current_mapping
    +

    current data mapping

    +
    tabID
    +

    ID for the tab containing the filter UI (used for testing)

    +
    filterVars
    +

    Variables to use for filtering (used for testing)

    +
    +
    +

    Value

    +

    filtered data set

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/filterTabChecks.html b/docs/reference/filterTabChecks.html new file mode 100644 index 00000000..1e52da30 --- /dev/null +++ b/docs/reference/filterTabChecks.html @@ -0,0 +1,121 @@ + +Checks for whether the current data and settings support a filter tab — filterTabChecks • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Checks for whether the current data and settings support a filter tab

    +
    + +
    +
    filterTabChecks(domainData, filterDomain, current_mapping)
    +
    + +
    +

    Arguments

    +
    domainData
    +

    list of data files for each domain

    +
    filterDomain
    +

    domain to use for filtering (typically "dm")

    +
    current_mapping
    +

    current data mapping (REACTIVE)

    +
    +
    +

    Value

    +

    reactive that returns a boolean indicating whether the checks passed and filtering can be initialized

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/filterTabUI.html b/docs/reference/filterTabUI.html new file mode 100644 index 00000000..37897f34 --- /dev/null +++ b/docs/reference/filterTabUI.html @@ -0,0 +1,113 @@ + +UI for the filter module in datamods::filter_data_ui — filterTabUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for the filter module in datamods::filter_data_ui

    +
    + +
    +
    filterTabUI(id)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/generateMappingList.html b/docs/reference/generateMappingList.html new file mode 100644 index 00000000..018252f7 --- /dev/null +++ b/docs/reference/generateMappingList.html @@ -0,0 +1,117 @@ + +Convert mapping data.frame to a list — generateMappingList • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Convert mapping data.frame to a list

    +
    + +
    +
    generateMappingList(settingsDF, domain = NULL, pull = FALSE)
    +
    + +
    +

    Arguments

    +
    settingsDF
    +

    data frame containing current mapping

    +
    domain
    +

    mapping domain to return (returns all domains as a named list by default)

    +
    pull
    +

    call pull() the value for each parameter - needed for testing only. default: FALSE

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/hasColumn.html b/docs/reference/hasColumn.html new file mode 100644 index 00000000..9ca6b751 --- /dev/null +++ b/docs/reference/hasColumn.html @@ -0,0 +1,128 @@ + +Check whether a column is found in a data set — hasColumn • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Checks whether a specified column is found in a specified data set

    +
    + +
    +
    hasColumn(columnName, data)
    +
    + +
    +

    Arguments

    +
    columnName
    +

    The column to look for.

    +
    data
    +

    the data.frame to search.

    +
    +
    +

    Value

    +

    logical scalar. TRUE if the column is found. FALSE otherwise

    +
    + +
    +

    Examples

    +
    safetyGraphics:::hasColumn(columnName="PARAM",data=safetyData::adam_adlbc) #TRUE
    +#> [1] TRUE
    +safetyGraphics:::hasColumn(columnName="Not_a_column",data=safetyData::adam_adlbc) #FALSE
    +#> [1] FALSE
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/hasField.html b/docs/reference/hasField.html new file mode 100644 index 00000000..5d084e10 --- /dev/null +++ b/docs/reference/hasField.html @@ -0,0 +1,141 @@ + +Check whether a specified field value is found in a data set — hasField • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    This checks whether a specific value is found in a specified column in a specified data set

    +
    + +
    +
    hasField(fieldValue, columnName, data)
    +
    + +
    +

    Arguments

    +
    fieldValue
    +

    A value to check for.

    +
    columnName
    +

    The column to check.

    +
    data
    +

    the data.frame to search.

    +
    +
    +

    Value

    +

    logical scalar. TRUE if field_value is found. FALSE otherwise

    +
    + +
    +

    Examples

    +
    #TRUE
    +safetyGraphics:::hasField(
    + fieldValue="Bilirubin (umol/L)",
    + columnName="PARAM",
    + data=safetyData::adam_adlbc
    +)
    +#> [1] TRUE
    +
    +#FALSE
    +safetyGraphics:::hasField(
    + fieldValue="Not_a_real_value",
    + columnName="",
    + data=safetyData::adam_adlbc
    +)
    +#> [1] FALSE
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/homeTab.html b/docs/reference/homeTab.html new file mode 100644 index 00000000..a27a0e9e --- /dev/null +++ b/docs/reference/homeTab.html @@ -0,0 +1,117 @@ + +Server for the filter module in datamods::filter_data_ui — homeTab • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for the filter module in datamods::filter_data_ui

    +
    + +
    +
    homeTab(input, output, session)
    +
    + +
    +

    Arguments

    +
    input
    +

    mod input

    +
    output
    +

    mod output

    +
    session
    +

    mod session

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/homeTabUI.html b/docs/reference/homeTabUI.html new file mode 100644 index 00000000..2c80837f --- /dev/null +++ b/docs/reference/homeTabUI.html @@ -0,0 +1,113 @@ + +UI for the home module — homeTabUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for the home module

    +
    + +
    +
    homeTabUI(id)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 00000000..ac1e2a10 --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,290 @@ + +Function reference • safetyGraphics + + +
    +
    + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Main Shiny App Functions

    +

    +
    +

    safetyGraphicsApp()

    +

    Run the core safetyGraphics App

    +

    safetyGraphicsInit()

    +

    App to select charts, load data and then initialize the core safetyGraphics app

    +

    Shiny Modules

    +

    Reusable Shiny Modules

    +
    +

    safetyGraphicsServer()

    +

    Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

    +

    safetyGraphicsUI()

    +

    UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

    +

    chartsTab()

    +

    Server for chart module, designed to be re-used for each chart generated.

    +

    chartsTabUI()

    +

    UI for chart module, designed to be re-used for each chart generated.

    +

    filterTab()

    +

    Server for the filter module in datamods::filter_data_ui

    +

    filterTabUI()

    +

    UI for the filter module in datamods::filter_data_ui

    +

    homeTab()

    +

    Server for the filter module in datamods::filter_data_ui

    +

    homeTabUI()

    +

    UI for the home module

    +

    loadCharts()

    +

    Server for the chart loading module used in safetyGraphicsInit()

    +

    loadChartsUI()

    +

    UI for the chart loading module used in safetyGraphicsInit()

    +

    loadData()

    +

    Server for the data loading module used in safetyGraphicsInit()

    +

    loadDataUI()

    +

    UI for the data loading module used in safetyGraphicsInit()

    +

    mappingTab()

    +

    Server for mapping tab covering of all data domains

    +

    mappingTabUI()

    +

    UI for mapping tab covering of all data domains

    +

    mappingDomain()

    +

    Server that facilitates the mapping of a full data domain

    +

    mappingDomainUI()

    +

    UI that facilitates the mapping of a full data domain

    +

    mappingColumn()

    +

    Server that facilitates the mapping of a column data (and any associated fields)

    +

    mappingColumnUI()

    +

    UI that facilitates the mapping of a column data (and any associated fields)

    +

    mappingSelect()

    +

    Server that facilitates the mapping of a single data element (column or field) with a simple select UI

    +

    mappingSelectUI()

    +

    UI that facilitates the mapping of a single data element (column or field) with a simple select UI

    +

    settingsTab()

    +

    Server for the setting page

    +

    settingsTabUI()

    +

    UI for the settings tab

    +

    settingsCharts()

    +

    Server for settings tab showing details for the charts loaded in the app

    +

    settingsChartsUI()

    +

    UI for settings tab showing details for the charts loaded in the app

    +

    settingsData()

    +

    Server for settings tab showing current data

    +

    settingsDataUI()

    +

    UI for settings tab showing current data

    +

    settingsMapping()

    +

    Server for settings tab showing current mapping

    +

    settingsMappingUI()

    +

    UI for settings tab showing current mapping

    +

    settingsCode()

    +

    Server for settings tab providing code to re-start the app with current data/settings

    +

    settingsCodeUI()

    +

    UI for settings tab providing code to re-start the app with current data/settings

    +

    Helper Functions

    +

    Utility functions used in the apps

    +
    +

    app_startup()

    +

    Startup code for shiny app

    +

    chartsNav()

    +

    Adds a navbar tab that initializes the Chart Module UI

    +

    detectStandard()

    +

    Detect the data standard used for a data set

    +

    evaluateStandard()

    +

    Evaluate a data set against a data standard

    +

    filterTabChecks()

    +

    Checks for whether the current data and settings support a filter tab

    +

    generateMappingList()

    +

    Convert mapping data.frame to a list

    +

    makeChartConfig()

    +

    Make Chart Config

    +

    makeChartExport()

    +

    Make Chart Export

    +

    makeChartParams()

    +

    Make Chart Parameters

    +

    makeChartSummary()

    +

    html chart summary

    +

    makeMapping()

    +

    Create data mapping based on data standards and user input

    +

    makeMeta()

    +

    Create a metadata object table for a set of charts

    +

    prepareChart()

    +

    Prepare a chart object for safetyGraphics

    + + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/loadCharts.html b/docs/reference/loadCharts.html new file mode 100644 index 00000000..9d29e774 --- /dev/null +++ b/docs/reference/loadCharts.html @@ -0,0 +1,119 @@ + +Server for the chart loading module used in safetyGraphicsInit() — loadCharts • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for the chart loading module used in safetyGraphicsInit()

    +
    + +
    +
    loadCharts(input, output, session, charts = makeChartConfig())
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    charts
    +

    list containing chart specifications like those returned by makeChartConfig.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/loadChartsUI.html b/docs/reference/loadChartsUI.html new file mode 100644 index 00000000..d7cc4b6e --- /dev/null +++ b/docs/reference/loadChartsUI.html @@ -0,0 +1,115 @@ + +UI for the chart loading module used in safetyGraphicsInit() — loadChartsUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for the chart loading module used in safetyGraphicsInit()

    +
    + +
    +
    loadChartsUI(id, charts = makeChartConfig())
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    charts
    +

    list containing chart specifications like those returned by makeChartConfig.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/loadData.html b/docs/reference/loadData.html new file mode 100644 index 00000000..c0df5d66 --- /dev/null +++ b/docs/reference/loadData.html @@ -0,0 +1,119 @@ + +Server for the data loading module used in safetyGraphicsInit() — loadData • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for the data loading module used in safetyGraphicsInit()

    +
    + +
    +
    loadData(input, output, session, domain)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    domain
    +

    data domain to be loaded

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/loadDataUI.html b/docs/reference/loadDataUI.html new file mode 100644 index 00000000..a41acc85 --- /dev/null +++ b/docs/reference/loadDataUI.html @@ -0,0 +1,115 @@ + +UI for the data loading module used in safetyGraphicsInit() — loadDataUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for the data loading module used in safetyGraphicsInit()

    +
    + +
    +
    loadDataUI(id, domain = NULL)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    domain
    +

    character vector with domains to be loaded

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/makeChartConfig.html b/docs/reference/makeChartConfig.html new file mode 100644 index 00000000..9ba48a52 --- /dev/null +++ b/docs/reference/makeChartConfig.html @@ -0,0 +1,139 @@ + +Make Chart Config — makeChartConfig • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Converts YAML chart configuration files to an R list and binds workflow functions. See the vignette about creating custom charts for more details.

    +
    + +
    +
    makeChartConfig(
    +  dirs,
    +  packages = "safetyCharts",
    +  packageLocation = "config",
    +  sourceFiles = FALSE
    +)
    +
    + +
    +

    Arguments

    +
    dirs
    +

    path to one or more directories containing yaml config files (relative to working directory)

    +
    packages
    +

    installed packages names containing yaml config files in the /inst/packageLocation folder

    +
    packageLocation
    +

    inst folder where yaml config files (and possibly R functions referenced in yaml workflow) are located in packages

    +
    sourceFiles
    +

    boolean indicating whether to source all R files found in dirs.

    +
    +
    +

    Value

    +

    returns a named list of charts derived from YAML files. Each element of the list contains information about a single chart, and has the following parameters:

    • "env" Environment for the chart. Must be set to "safetyGraphics" or the chart is dropped.

    • +
    • "name" Name of the chart. Also the name of the element in the list - e.g. charts$aeExplorer$name is "aeExplorer"

    • +
    • "label" Short description of the chart

    • +
    • "type" Type of chart; options are: 'htmlwidget', 'module', 'plot', 'table', 'html' or 'plotly'.

    • +
    • "domain" Data domain. Should correspond to one or more domains in meta

    • +
    • "package" Primary package (if any). Other packages can be loaded directly in workflow functions.

    • +
    • "order" Integer order in which to display the chart. If order is a negative number, the chart is dropped.

    • +
    • "export" Logical flag indicating whether the chart can be exported to an html report. True by default, except for when type is module.

    • +
    • "path" Path to YAML file

    • +
    • "links" Named list of link names/urls to be shown in the chart header.

    • +
    • "workflow" List of functions names used to render chart. See vignette for details.

    • +
    • "functions" List of functions for use in chart renderering. These functions must be located in the global environment or package field of the YAML config. Function names must include either the name or workflow fields of the YAML config.

    • +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/makeChartExport.html b/docs/reference/makeChartExport.html new file mode 100644 index 00000000..410e4d61 --- /dev/null +++ b/docs/reference/makeChartExport.html @@ -0,0 +1,119 @@ + +Make Chart Export — makeChartExport • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Creates R code that allows chart to be exported

    +
    + +
    +
    makeChartExport(chart, mapping)
    +
    + +
    +

    Arguments

    +
    chart
    +

    chart object like the one generated by makeChartConfig().

    +
    mapping
    +

    mapping object like the one generated by makeMapping().

    +
    +
    +

    Value

    +

    returns a character vector that can be saved as R code.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/makeChartParams.html b/docs/reference/makeChartParams.html new file mode 100644 index 00000000..cf4383a6 --- /dev/null +++ b/docs/reference/makeChartParams.html @@ -0,0 +1,117 @@ + +Make Chart Parameters — makeChartParams • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Updates raw data and mapping for use with a specific chart

    +
    + +
    +
    makeChartParams(data, chart, mapping)
    +
    + +
    +

    Arguments

    +
    data
    +

    list of domain-level data

    +
    chart
    +

    list containing chart specifications

    +
    mapping
    +

    data frame with current mapping

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/makeChartSummary.html b/docs/reference/makeChartSummary.html new file mode 100644 index 00000000..3380b78c --- /dev/null +++ b/docs/reference/makeChartSummary.html @@ -0,0 +1,117 @@ + +html chart summary — makeChartSummary • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    makes a nicely formatted html summary for a chart object

    +
    + +
    +
    makeChartSummary(chart, showLinks = TRUE, class = "chart-header")
    +
    + +
    +

    Arguments

    +
    chart
    +

    list containing chart specifications

    +
    showLinks
    +

    boolean indicating whether to include links

    +
    class
    +

    character to include as class

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/makeMapping.html b/docs/reference/makeMapping.html new file mode 100644 index 00000000..223b14a4 --- /dev/null +++ b/docs/reference/makeMapping.html @@ -0,0 +1,124 @@ + +Create data mapping based on data standards and user input — makeMapping • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Create data mapping based on data standards and user input

    +
    + +
    +
    makeMapping(domainData, meta, autoMapping, customMapping)
    +
    + +
    +

    Arguments

    +
    domainData
    +

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    +
    meta
    +

    data frame containing the metadata for use in the app.

    +
    autoMapping
    +

    boolean indicating whether the app should use safetyGraphics::detectStandard() to detect data standards and automatically generate mappings for the data provided. Values specified in the customMapping parameter overwrite auto-generated mappings when both are found. Defaults to true.

    +
    customMapping
    +

    optional list specifying initial mapping values within each data mapping (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    +
    +
    +

    Value

    +

    List containing data standard information and mapping

    • "mapping" Initial Data Mapping

    • +
    • "standards" List of domain level data standards (or NULL if autoMapping is false)

    • +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/makeMeta.html b/docs/reference/makeMeta.html new file mode 100644 index 00000000..f1295474 --- /dev/null +++ b/docs/reference/makeMeta.html @@ -0,0 +1,156 @@ + +Create a metadata object table for a set of charts — makeMeta • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Generates metadata object for a list of charts. makeMeta() looks for metadata in 3 locations for each chart object:

    • Domain-level metadata saved as meta_chart$name in the chart$package namespace

    • +
    • Chart-specific metadata saved as meta_chart$domain in the chart$package namespace

    • +
    • Chart-specific metadata saved directly to the chart object as chart$meta +After checking all charts, all metadata files are stacked in to a single dataframe and returned. If duplicate metadata rows (domain + text_key) are found, an error is thrown.

    • +
    + +
    +
    makeMeta(charts)
    +
    + +
    +

    Arguments

    +
    charts
    +

    list of safetyGraphics chart objects for which to create metadata

    +
    +
    +

    Value

    +

    tibble of metadata with the following columns:

    domain
    +

    Data domain

    + +
    text_key
    +

    Text key indicating the setting name. '--' delimiter indicates a field level data mapping

    + +
    col_key
    +

    Key for the column mapping

    + +
    field_key
    +

    Key for the field mapping (if any)

    + +
    type
    +

    type of mapping - "field" or "column"

    + +
    label
    +

    Label

    + +
    description
    +

    Description

    + +
    multiple
    +

    Mapping supports multiple columns/fields

    + +
    standard_adam
    +

    Default values for the ADaM data standard

    + +
    standard_sdtm
    +

    Default values for the SDTM data standard

    + + +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingColumn.html b/docs/reference/mappingColumn.html new file mode 100644 index 00000000..f162b3fb --- /dev/null +++ b/docs/reference/mappingColumn.html @@ -0,0 +1,125 @@ + +Server that facilitates the mapping of a column data (and any associated fields) — mappingColumn • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server that facilitates the mapping of a column data (and any associated fields)

    +
    + +
    +
    mappingColumn(input, output, session, meta, data)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    meta
    +

    metadata data frame for the object

    +
    data
    +

    current data file for the domain

    +
    +
    +

    Value

    +

    A reactive data.frame providing the current value for text_key associated with the selected column

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingColumnUI.html b/docs/reference/mappingColumnUI.html new file mode 100644 index 00000000..8a75157c --- /dev/null +++ b/docs/reference/mappingColumnUI.html @@ -0,0 +1,119 @@ + +UI that facilitates the mapping of a column data (and any associated fields) — mappingColumnUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI that facilitates the mapping of a column data (and any associated fields)

    +
    + +
    +
    mappingColumnUI(id, meta, data, mapping = NULL)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    meta
    +

    metadata for the column (and related fields)

    +
    data
    +

    current data file for the domain

    +
    mapping
    +

    current data mapping for the column (and related fields)

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingDomain.html b/docs/reference/mappingDomain.html new file mode 100644 index 00000000..215737fe --- /dev/null +++ b/docs/reference/mappingDomain.html @@ -0,0 +1,125 @@ + +Server that facilitates the mapping of a full data domain — mappingDomain • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server that facilitates the mapping of a full data domain

    +
    + +
    +
    mappingDomain(input, output, session, meta, data)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    meta
    +

    metadata for the domain

    +
    data
    +

    clinical data for the domain

    +
    +
    +

    Value

    +

    A reactive data frame containing the mapping for the domain

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingDomainUI.html b/docs/reference/mappingDomainUI.html new file mode 100644 index 00000000..c622ec66 --- /dev/null +++ b/docs/reference/mappingDomainUI.html @@ -0,0 +1,119 @@ + +UI that facilitates the mapping of a full data domain — mappingDomainUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI that facilitates the mapping of a full data domain

    +
    + +
    +
    mappingDomainUI(id, meta, data, mapping = NULL)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    meta
    +

    metadata for the domain

    +
    data
    +

    data file for the domain

    +
    mapping
    +

    current data mapping

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingSelect.html b/docs/reference/mappingSelect.html new file mode 100644 index 00000000..e1f3438e --- /dev/null +++ b/docs/reference/mappingSelect.html @@ -0,0 +1,121 @@ + +Server that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelect • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server that facilitates the mapping of a single data element (column or field) with a simple select UI

    +
    + +
    +
    mappingSelect(input, output, session)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    +
    +

    Value

    +

    A reactive containing the selected column

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingSelectUI.html b/docs/reference/mappingSelectUI.html new file mode 100644 index 00000000..fdf6bd7e --- /dev/null +++ b/docs/reference/mappingSelectUI.html @@ -0,0 +1,123 @@ + +UI that facilitates the mapping of a single data element (column or field) with a simple select UI — mappingSelectUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI that facilitates the mapping of a single data element (column or field) with a simple select UI

    +
    + +
    +
    mappingSelectUI(id, label, choices = NULL, default = NULL)
    +
    + +
    +

    Arguments

    +
    id
    +

    unique id for the UI

    +
    label
    +

    label associated with the control

    +
    choices
    +

    a list of options for the control

    +
    default
    +

    default value for the control

    +
    +
    +

    Value

    +

    returns the selected value wrapped in a reactive().

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingTab.html b/docs/reference/mappingTab.html new file mode 100644 index 00000000..93adc97a --- /dev/null +++ b/docs/reference/mappingTab.html @@ -0,0 +1,125 @@ + +Server for mapping tab covering of all data domains — mappingTab • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for mapping tab covering of all data domains

    +
    + +
    +
    mappingTab(input, output, session, meta, domainData)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    meta
    +

    metadata for all domains

    +
    domainData
    +

    clinical data for all domains

    +
    +
    +

    Value

    +

    list of mappings for all domains

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/mappingTabUI.html b/docs/reference/mappingTabUI.html new file mode 100644 index 00000000..b10f27dd --- /dev/null +++ b/docs/reference/mappingTabUI.html @@ -0,0 +1,121 @@ + +UI for mapping tab covering of all data domains — mappingTabUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for mapping tab covering of all data domains

    +
    + +
    +
    mappingTabUI(id, meta, domainData, mappings = NULL, standards = NULL)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    meta
    +

    metadata for all domains

    +
    domainData
    +

    list of data files for each domain

    +
    mappings
    +

    optional data frame containing stacked mappings for all domains

    +
    standards
    +

    optional list of data standards like the ones generated by detectStandard()

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/pipe.html b/docs/reference/pipe.html new file mode 100644 index 00000000..5d6d7f62 --- /dev/null +++ b/docs/reference/pipe.html @@ -0,0 +1,108 @@ + +Pipe operator — %>% • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    See magrittr::%>% for details.

    +
    + +
    +
    lhs %>% rhs
    +
    + + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/prepareChart.html b/docs/reference/prepareChart.html new file mode 100644 index 00000000..ca0a5a82 --- /dev/null +++ b/docs/reference/prepareChart.html @@ -0,0 +1,117 @@ + +Prepare a chart object for safetyGraphics — prepareChart • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Sets default values and binds needed functions to a chart object based on chart type.

    +
    + +
    +
    prepareChart(chart)
    +
    + +
    +

    Arguments

    +
    chart
    +

    chart object like the one generated by makeChartConfig().

    +
    +
    +

    Value

    +

    returns the chart object with a new functions object added.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/safetyGraphicsApp.html b/docs/reference/safetyGraphicsApp.html new file mode 100644 index 00000000..b76f1b80 --- /dev/null +++ b/docs/reference/safetyGraphicsApp.html @@ -0,0 +1,137 @@ + +Run the core safetyGraphics App — safetyGraphicsApp • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Run the core safetyGraphics App

    +
    + +
    +
    safetyGraphicsApp(
    +  domainData = list(labs = safetyData::adam_adlbc, aes = safetyData::adam_adae, dm =
    +    safetyData::adam_adsl),
    +  meta = NULL,
    +  charts = NULL,
    +  mapping = NULL,
    +  autoMapping = TRUE,
    +  filterDomain = "dm",
    +  chartSettingsPaths = NULL,
    +  runNow = TRUE
    +)
    +
    + +
    +

    Arguments

    +
    domainData
    +

    named list of data.frames to be loaded in to the app. Sample AdAM data from the safetyData package used by default

    +
    meta
    +

    data frame containing the metadata for use in the app. If no metadata is provided, metatdata is generated by makeMeta().

    +
    charts
    +

    list of charts in the format produced by safetyGraphics::makeChartConfig()

    +
    mapping
    +

    list specifying the initial mapping values for each data mapping for each domain (e.g. list(aes= list(id_col='USUBJID', seq_col='AESEQ')).

    +
    autoMapping
    +

    boolean indicating whether the app should attempt to automatically detect data standards and generate mappings for the data provided. Values specified in the mapping parameter overwrite automatically generated mappings when both are found. Defaults to true.

    +
    filterDomain
    +

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    +
    chartSettingsPaths
    +

    path(s) where customization functions are saved relative to your working directory. All charts can have initialization (e.g. myChart_Init.R) and static charts can have charting functions (e.g. myGraphic_Chart.R). All R files in this folder are sourced and files with the correct naming convention are linked to the chart. See the Custom Charts vignette for more details.

    +
    runNow
    +

    Should the shiny app object created be run directly? Helpful when writing functions to dispatch to shinyapps, rsconnect, or shinyproxy.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/safetyGraphicsInit.html b/docs/reference/safetyGraphicsInit.html new file mode 100644 index 00000000..33cb93c7 --- /dev/null +++ b/docs/reference/safetyGraphicsInit.html @@ -0,0 +1,121 @@ + +App to select charts, load data and then initialize the core safetyGraphics app — safetyGraphicsInit • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    App to select charts, load data and then initialize the core safetyGraphics app

    +
    + +
    +
    safetyGraphicsInit(
    +  charts = makeChartConfig(),
    +  delayTime = 1000,
    +  maxFileSize = NULL
    +)
    +
    + +
    +

    Arguments

    +
    charts
    +

    chart object

    +
    delayTime
    +

    time (in ms) between drawing app UI and starting server. Default set to 1000 (1 second), but could need to be higher on slow machine.

    +
    maxFileSize
    +

    maximum file size in MB allowed for file upload

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/safetyGraphicsServer.html b/docs/reference/safetyGraphicsServer.html new file mode 100644 index 00000000..e896d0d3 --- /dev/null +++ b/docs/reference/safetyGraphicsServer.html @@ -0,0 +1,136 @@ + +Server for core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsServer • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    This function returns a server function suitable for use in shiny::runApp()

    +
    + +
    +
    safetyGraphicsServer(
    +  input,
    +  output,
    +  session,
    +  meta,
    +  mapping,
    +  domainData,
    +  charts,
    +  filterDomain
    +)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    meta
    +

    data frame containing the metadata for use in the app.

    +
    mapping
    +

    current mapping

    +
    domainData
    +

    named list of data.frames to be loaded in to the app.

    +
    charts
    +

    list of charts to include in the app

    +
    filterDomain
    +

    domain used for the data/filter tab. Demographics ("dm") is used by default. Using a domain that is not one record per participant is not recommended.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/safetyGraphicsUI.html b/docs/reference/safetyGraphicsUI.html new file mode 100644 index 00000000..c7eab72f --- /dev/null +++ b/docs/reference/safetyGraphicsUI.html @@ -0,0 +1,121 @@ + +UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules. — safetyGraphicsUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for the core safetyGraphics app including Home, Mapping, Filter, Charts and Settings modules.

    +
    + +
    +
    safetyGraphicsUI(id, meta, domainData, mapping, standards)
    +
    + +
    +

    Arguments

    +
    id
    +

    module ID

    +
    meta
    +

    data frame containing the metadata for use in the app.

    +
    domainData
    +

    named list of data.frames to be loaded in to the app.

    +
    mapping
    +

    data.frame specifying the initial values for each data mapping. If no mapping is provided, the app will attempt to generate one via detectStandard()

    +
    standards
    +

    a list of information regarding data standards. Each list item should use the format returned by safetyGraphics::detectStandard.

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/setMappingListValue.html b/docs/reference/setMappingListValue.html new file mode 100644 index 00000000..db126349 --- /dev/null +++ b/docs/reference/setMappingListValue.html @@ -0,0 +1,136 @@ + +Set the value for a given named parameter — setMappingListValue • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Sets the value for a named parameter (key) to given value in a list (settings)

    +
    + +
    +
    setMappingListValue(key, value, settings, forceCreate = FALSE)
    +
    + +
    +

    Arguments

    +
    key
    +

    a list defining the position of parameter in the settings object.

    +
    value
    +

    the value to set

    +
    settings
    +

    The settings list used to generate a chart like eDISH()

    +
    forceCreate
    +

    Specifies whether the function should create a new list() when none exisits. This most commonly occurs when deeply nested objects.

    +
    +
    +

    Value

    +

    the updated settings object

    +
    + +
    +

    Examples

    +
    testSet<-list(a=list(b="myValue"))
    +safetyGraphics:::setMappingListValue(key=list("a","b"), value="notMyValue", settings=testSet) 
    +#> $a
    +#> $a$b
    +#> [1] "notMyValue"
    +#> 
    +#> 
    +#returns list(a=list(b="notMyValue")))
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsCharts.html b/docs/reference/settingsCharts.html new file mode 100644 index 00000000..80b721fe --- /dev/null +++ b/docs/reference/settingsCharts.html @@ -0,0 +1,119 @@ + +Server for settings tab showing details for the charts loaded in the app — settingsCharts • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for settings tab showing details for the charts loaded in the app

    +
    + +
    +
    settingsCharts(input, output, session, charts)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    charts
    +

    list data frame summarizing the charts

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsChartsUI.html b/docs/reference/settingsChartsUI.html new file mode 100644 index 00000000..ba903493 --- /dev/null +++ b/docs/reference/settingsChartsUI.html @@ -0,0 +1,113 @@ + +UI for settings tab showing details for the charts loaded in the app — settingsChartsUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for settings tab showing details for the charts loaded in the app

    +
    + +
    +
    settingsChartsUI(id)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsCode.html b/docs/reference/settingsCode.html new file mode 100644 index 00000000..3de8f77c --- /dev/null +++ b/docs/reference/settingsCode.html @@ -0,0 +1,123 @@ + +Server for settings tab providing code to re-start the app with current data/settings — settingsCode • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for settings tab providing code to re-start the app with current data/settings

    +
    + +
    +
    settingsCode(input, output, session, mapping, charts, domainData)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    mapping
    +

    mapping

    +
    charts
    +

    charts

    +
    domainData
    +

    data list

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsCodeUI.html b/docs/reference/settingsCodeUI.html new file mode 100644 index 00000000..b3bfcee6 --- /dev/null +++ b/docs/reference/settingsCodeUI.html @@ -0,0 +1,113 @@ + +UI for settings tab providing code to re-start the app with current data/settings — settingsCodeUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for settings tab providing code to re-start the app with current data/settings

    +
    + +
    +
    settingsCodeUI(id)
    +
    + +
    +

    Arguments

    +
    id
    +

    module ID

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsData.html b/docs/reference/settingsData.html new file mode 100644 index 00000000..13ead6d1 --- /dev/null +++ b/docs/reference/settingsData.html @@ -0,0 +1,119 @@ + +Server for settings tab showing current data — settingsData • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for settings tab showing current data

    +
    + +
    +
    settingsData(input, output, session, domains)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    domains
    +

    named list of the data.frames for each domain

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsDataUI.html b/docs/reference/settingsDataUI.html new file mode 100644 index 00000000..a1cde00a --- /dev/null +++ b/docs/reference/settingsDataUI.html @@ -0,0 +1,113 @@ + +UI for settings tab showing current data — settingsDataUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for settings tab showing current data

    +
    + +
    +
    settingsDataUI(id)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsMapping.html b/docs/reference/settingsMapping.html new file mode 100644 index 00000000..846494a9 --- /dev/null +++ b/docs/reference/settingsMapping.html @@ -0,0 +1,121 @@ + +Server for settings tab showing current mapping — settingsMapping • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for settings tab showing current mapping

    +
    + +
    +
    settingsMapping(input, output, session, metadata, mapping)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    metadata
    +

    Data mapping metadata used for initial loading of app

    +
    mapping
    +

    reactive data frame representing the current metadata mapping. columns = "domain", "text_id" and "current"

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsMappingUI.html b/docs/reference/settingsMappingUI.html new file mode 100644 index 00000000..d2f19e3b --- /dev/null +++ b/docs/reference/settingsMappingUI.html @@ -0,0 +1,113 @@ + +UI for settings tab showing current mapping — settingsMappingUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for settings tab showing current mapping

    +
    + +
    +
    settingsMappingUI(id)
    +
    + +
    +

    Arguments

    +
    id
    +

    module id

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsTab.html b/docs/reference/settingsTab.html new file mode 100644 index 00000000..08450de2 --- /dev/null +++ b/docs/reference/settingsTab.html @@ -0,0 +1,125 @@ + +Server for the setting page — settingsTab • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Server for the setting page

    +
    + +
    +
    settingsTab(input, output, session, domains, metadata, mapping, charts)
    +
    + +
    +

    Arguments

    +
    input
    +

    Shiny input object

    +
    output
    +

    Shiny output object

    +
    session
    +

    Shiny session object

    +
    domains
    +

    domains

    +
    metadata
    +

    metadata

    +
    mapping
    +

    mapping

    +
    charts
    +

    charts

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/settingsTabUI.html b/docs/reference/settingsTabUI.html new file mode 100644 index 00000000..728f8f1b --- /dev/null +++ b/docs/reference/settingsTabUI.html @@ -0,0 +1,113 @@ + +UI for the settings tab — settingsTabUI • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    UI for the settings tab

    +
    + +
    +
    settingsTabUI(id)
    +
    + +
    +

    Arguments

    +
    id
    +

    module ID

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/textKeysToList.html b/docs/reference/textKeysToList.html new file mode 100644 index 00000000..f61b7557 --- /dev/null +++ b/docs/reference/textKeysToList.html @@ -0,0 +1,145 @@ + +Helper function to convert keys from text to nested lists — textKeysToList • safetyGraphics + + +
    +
    + + + +
    +
    + + +
    +

    Convert settings keys from text vectors (using the "--" delimiter) to a list of lists

    +
    + +
    +
    textKeysToList(textKeys)
    +
    + +
    +

    Arguments

    +
    textKeys
    +

    a list (or vector) of character keys using the "--" delimiter to indicate hierarchy

    +
    +
    +

    Value

    +

    A list of unnamed lists, with position in the nested list indicating hierarchy

    +
    + +
    +

    Examples

    +
    safetyGraphics:::textKeysToList("id_col") 
    +#> [[1]]
    +#> [[1]][[1]]
    +#> [1] "id_col"
    +#> 
    +#> 
    +#list(list("id_col"))
    +
    +#list(list("id_col"),list("measure_col","label"))
    +safetyGraphics:::textKeysToList(c("id_col","measure_col--label")) 
    +#> [[1]]
    +#> [[1]][[1]]
    +#> [1] "id_col"
    +#> 
    +#> 
    +#> [[2]]
    +#> [[2]][[1]]
    +#> [1] "measure_col"
    +#> 
    +#> [[2]][[2]]
    +#> [1] "label"
    +#> 
    +#> 
    +
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.2.

    +
    + +
    + + + + + + + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml new file mode 100644 index 00000000..6c8b841b --- /dev/null +++ b/docs/sitemap.xml @@ -0,0 +1,192 @@ + + + + https://safetygraphics.github.io/safetyGraphics/404.html + + + https://safetygraphics.github.io/safetyGraphics/LICENSE-text.html + + + https://safetygraphics.github.io/safetyGraphics/LICENSE.html + + + https://safetygraphics.github.io/safetyGraphics/articles/ChartConfiguration.html + + + https://safetygraphics.github.io/safetyGraphics/articles/Cookbook.html + + + https://safetygraphics.github.io/safetyGraphics/articles/Intro.html + + + https://safetygraphics.github.io/safetyGraphics/articles/TechnicalFAQ.html + + + https://safetygraphics.github.io/safetyGraphics/articles/index.html + + + https://safetygraphics.github.io/safetyGraphics/authors.html + + + https://safetygraphics.github.io/safetyGraphics/index.html + + + https://safetygraphics.github.io/safetyGraphics/news/index.html + + + https://safetygraphics.github.io/safetyGraphics/reference/SafetyGraphics.html + + + https://safetygraphics.github.io/safetyGraphics/reference/app_startup.html + + + https://safetygraphics.github.io/safetyGraphics/reference/chartsNav.html + + + https://safetygraphics.github.io/safetyGraphics/reference/chartsTab.html + + + https://safetygraphics.github.io/safetyGraphics/reference/chartsTabUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/detectStandard.html + + + https://safetygraphics.github.io/safetyGraphics/reference/evaluateStandard.html + + + https://safetygraphics.github.io/safetyGraphics/reference/filterTab.html + + + https://safetygraphics.github.io/safetyGraphics/reference/filterTabChecks.html + + + https://safetygraphics.github.io/safetyGraphics/reference/filterTabUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/generateMappingList.html + + + https://safetygraphics.github.io/safetyGraphics/reference/hasColumn.html + + + https://safetygraphics.github.io/safetyGraphics/reference/hasField.html + + + https://safetygraphics.github.io/safetyGraphics/reference/homeTab.html + + + https://safetygraphics.github.io/safetyGraphics/reference/homeTabUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/index.html + + + https://safetygraphics.github.io/safetyGraphics/reference/loadCharts.html + + + https://safetygraphics.github.io/safetyGraphics/reference/loadChartsUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/loadData.html + + + https://safetygraphics.github.io/safetyGraphics/reference/loadDataUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/makeChartConfig.html + + + https://safetygraphics.github.io/safetyGraphics/reference/makeChartExport.html + + + https://safetygraphics.github.io/safetyGraphics/reference/makeChartParams.html + + + https://safetygraphics.github.io/safetyGraphics/reference/makeChartSummary.html + + + https://safetygraphics.github.io/safetyGraphics/reference/makeMapping.html + + + https://safetygraphics.github.io/safetyGraphics/reference/makeMeta.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingColumn.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingColumnUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingDomain.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingDomainUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingSelect.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingSelectUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingTab.html + + + https://safetygraphics.github.io/safetyGraphics/reference/mappingTabUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/pipe.html + + + https://safetygraphics.github.io/safetyGraphics/reference/prepareChart.html + + + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsApp.html + + + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsInit.html + + + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsServer.html + + + https://safetygraphics.github.io/safetyGraphics/reference/safetyGraphicsUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/setMappingListValue.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsCharts.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsChartsUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsCode.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsCodeUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsData.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsDataUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsMapping.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsMappingUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsTab.html + + + https://safetygraphics.github.io/safetyGraphics/reference/settingsTabUI.html + + + https://safetygraphics.github.io/safetyGraphics/reference/textKeysToList.html + +