A widget that generates a time series of group-level metric results over time, plotting snapshot date on the x-axis and the outcome (numerator, denominator, metric, or score) on the y-axis.
Usage
Widget_TimeSeries(
dfResults,
lMetric = NULL,
dfGroups = NULL,
vThreshold = NULL,
strOutcome = "Score",
vOutcomeOptions = c("Score", "Metric", "Numerator"),
bAddGroupSelect = TRUE,
strShinyGroupSelectID = "GroupID",
strOutputLabel = paste0(fontawesome::fa("chart-line", fill = "#337ab7"),
" Time Series"),
bDebug = FALSE,
...
)Arguments
- dfResults
data.frameA stacked summary of analysis pipeline output. Created by passing a list of results returned bygsm.core::Summarize()togsm.reporting::BindResults(). 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 togsm.reporting::MakeMetric()and turning 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.core").- dfGroups
data.frameGroup-level metadata dictionary. Created by passing CTMS site and study data togsm.mapping::MakeLongMeta(). Expected columns:GroupID,GroupLevel,Param,Value.- vThreshold
numericThreshold value(s).- strOutcome
characterOutcome variable. Default: 'Score'.- vOutcomeOptions
characterVector of outcome options for the y-axis dropdown. Default:c("Score", "Metric", "Numerator"). Must includestrOutcome.- bAddGroupSelect
logicalAdd a dropdown to highlight sites? Default:TRUE.- strShinyGroupSelectID
characterElement ID of group select in Shiny context. Default:'GroupID'.- strOutputLabel
characterLabel describing the output object, which is assigned to theoutput_labelattribute of the output object and appears in the report generated bygsm.kri::Report_KRI().- bDebug
logicalPrint debug messages? Default:FALSE.- ...
anyAdditional chart configuration settings.
Examples
## Filter data to one metric
reportingResults_filter <- gsm.core::reportingResults %>%
dplyr::filter(MetricID == "Analysis_kri0001")
reportingMetrics_filter <- gsm.core::reportingMetrics %>%
dplyr::filter(MetricID == "Analysis_kri0001") %>%
as.list()
Widget_TimeSeries(
dfResults = reportingResults_filter,
lMetric = reportingMetrics_filter,
dfGroups = gsm.core::reportingGroups,
vThreshold = reportingMetrics_filter$Threshold
)