From 345658726dd28fe339ec1da5000f195c8d4218f3 Mon Sep 17 00:00:00 2001 From: Jeremy Wildfire Date: Thu, 24 Mar 2022 13:25:36 -0400 Subject: [PATCH 1/3] 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 3/3] 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