Skip to contents

modified gsm.kri::Widget_BarChart() to include ExpectedNumerator as the default outcome.

Usage

Widget_BarChartSimaerep(
  dfResults,
  lMetric = NULL,
  dfGroups = NULL,
  vThreshold = NULL,
  strOutcome = "ExpectedNumerator",
  bAddGroupSelect = TRUE,
  strShinyGroupSelectID = "GroupID",
  strOutputLabel = paste0(fontawesome::fa("chart-simple", fill = "#337ab7"),
    "  Bar Chart"),
  vResultTooltipKeys = c("ExpectedNumerator", "Score", "Metric", "Numerator",
    "Denominator"),
  ...
)

Arguments

dfResults

`data.frame` A stacked summary of analysis pipeline output. Created by passing a list of results returned by [Summarize()] to [BindResults()]. Expected columns: `GroupID`, `GroupLevel`, `Numerator`, `Denominator`, `Metric`, `Score`, `Flag`, `MetricID`, `StudyID`, `SnapshotDate`.

lMetric

`list` Metric-specific metadata for use in charts and reporting. Created by passing an `lWorkflow` object to [MakeMetric()] and turing it into a list. Expected columns: `File`,`MetricID`, `Group`, `Abbreviation`, `Metric`, `Numerator`, `Denominator`, `Model`, `Score`, and `strThreshold`. For more details see the Data Model vignette: `vignette("DataModel", package = "gsm.kri")`.

dfGroups

`data.frame` Group-level metadata dictionary. Created by passing CTMS site and study data to [MakeLongMeta()]. Expected columns: `GroupID`, `GroupLevel`, `Param`, `Value`.

vThreshold

numeric Threshold values.

strOutcome

character Outcome variable. Default: 'ExpectedNumerator'.

bAddGroupSelect

`logical` Add a dropdown to highlight sites? Default: `TRUE`.

strShinyGroupSelectID

`character` Element ID of group select in Shiny context. Default: `'GroupID'`.

strOutputLabel

`character` Label describing the output object, which is assigned to the `output_label` attribute of the output object and appears in the report generated by [gsm.kri::Report_KRI()]..

vResultTooltipKeys

character Result tooltip keys. Default: c("ExpectedNumerator", "Score", "Metric", "Numerator", "Denominator").

...

`any` Additional chart configuration settings.

Examples

## Filter data to one metric and snapshot
reportingResults_filter <- gsm.core::reportingResults %>%
  dplyr::filter(MetricID == "Analysis_kri0001" & SnapshotDate == max(SnapshotDate))

reportingMetrics_filter <- gsm.core::reportingMetrics %>%
  dplyr::filter(MetricID == "Analysis_kri0001") %>%
  as.list()

## Make chart
Widget_BarChartSimaerep(
  dfResults = reportingResults_filter,
  dfGroups = gsm.core::reportingGroups,
  lMetric = reportingMetrics_filter,
  vThreshold = reportingMetrics_filter$Threshold
)