This function generates a summary table for a report by joining the provided results data frame with the site-level metadata from dfGroups. It then filters and arranges the data based on certain conditions and displays the result in a datatable.
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. For this function,dfResultsmust be filtered to a single KRI (MetricID).- dfGroups
data.frameGroup-level metadata dictionary. Created by passing CTMS site and study data toMakeLongMeta(). Expected columns:GroupID,GroupLevel,Param,Value.- strGroupLevel
group level for the table
- strGroupDetailsParams
one or more parameters from dfGroups to be added as columns in the table
- vFlags
integerList of flag values to include in output table. Default:c(-2, -1, 1, 2).
Value
A gt::gt() containing the summary table.
Examples
# site-level report
Report_MetricTable(
dfResults = reportingResults %>%
dplyr::filter(.data$MetricID == "Analysis_kri0001") %>%
FilterByLatestSnapshotDate(),
dfGroups = reportingGroups
)
Group
Enrolled
Numerator
Denominator
Metric
Score
Flag