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",
bAddGroupSelect = TRUE,
strShinyGroupSelectID = "GroupID",
bDebug = FALSE
)
Arguments
- dfResults
data.frame
A 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
list
Metric-specific metadata for use in charts and reporting. Created by passing anlWorkflow
object 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.frame
Group-level metadata dictionary. Created by passing CTMS site and study data toMakeLongMeta()
. Expected columns:GroupID
,GroupLevel
,Param
,Value
.- vThreshold
numeric
Threshold value(s).- strOutcome
character
Outcome variable. Default: 'Score'.- bAddGroupSelect
logical
Add a dropdown to highlight sites? Default:TRUE
.- strShinyGroupSelectID
character
Element ID of group select in Shiny context. Default:'GroupID'
.- bDebug
logical
Print debug messages? Default:FALSE
.
Examples
## Filter data to one metric
reportingResults_filter <- reportingResults %>%
dplyr::filter(MetricID == "Analysis_kri0001")
reportingMetrics_filter <- reportingMetrics %>%
dplyr::filter(MetricID == "Analysis_kri0001") %>%
as.list()
Widget_TimeSeries(
dfResults = reportingResults_filter,
lMetric = reportingMetrics_filter,
dfGroups = reportingGroups,
vThreshold = reportingMetrics_filter$Threshold
)