A widget that generates a scatter plot of group-level metric results, plotting the denominator on the x-axis and the numerator on the y-axis.
Usage
Widget_ScatterPlot(
dfResults,
lMetric = NULL,
dfGroups = NULL,
dfBounds = NULL,
bAddGroupSelect = TRUE,
strShinyGroupSelectID = "GroupID",
bDebug = FALSE
)Arguments
- dfResults
data.frameA stacked summary of analysis pipeline output. Created by passing a list of results returned bySummarize()toBindResults(). Expected columns:GroupID,GroupLevel,Numerator,Denominator,Metric,Score,Flag,MetricID,StudyID,SnapshotDate.- lMetric
listMetric-specific metadata for use in charts and reporting. Created by passing anlWorkflowobject toMakeMetric()and turing it into a list. Expected columns:File,MetricID,Group,Abbreviation,Metric,Numerator,Denominator,Model,Score, andstrThreshold. For more details see the Data Model vignette:vignette("DataModel", package = "gsm").- dfGroups
data.frameGroup-level metadata dictionary. Created by passing CTMS site and study data toMakeLongMeta(). Expected columns:GroupID,GroupLevel,Param,Value.- dfBounds
data.frameSet of predicted percentages/rates and upper- and lower-bounds across the full range of sample sizes/total exposure values for reporting. Created by passingdfResultsanddfMetricstoMakeBounds(). Expected columns:Threshold,Denominator,Numerator,Metric,MetricID,StudyID,SnapshotDate.- bAddGroupSelect
logicalAdd a dropdown to highlight sites? Default:TRUE.- strShinyGroupSelectID
characterElement ID of group select in Shiny context. Default:'GroupID'.- bDebug
logicalPrint debug messages? Default:FALSE.
Examples
## Filter data to one metric and snapshot
reportingResults_filter <- reportingResults %>%
dplyr::filter(MetricID == "Analysis_kri0001" & SnapshotDate == max(SnapshotDate))
reportingMetrics_filter <- reportingMetrics %>%
dplyr::filter(MetricID == "Analysis_kri0001") %>%
as.list()
reportingBounds_filter <- reportingBounds %>%
dplyr::filter(MetricID == "Analysis_kri0001" & SnapshotDate == max(SnapshotDate))
Widget_ScatterPlot(
dfResults = reportingResults_filter,
lMetric = reportingMetrics_filter,
dfGroups = reportingGroups,
dfBounds = reportingBounds_filter
)