View source: R/scoring_primitives.R
| aggregate_indicator_score | R Documentation |
Computes summary scores from an evidence table, grouped by one or more columns.
aggregate_indicator_score(
ev,
by = "indicator_id",
method = c("mean", "min", "weighted")
)
ev |
A valid evidence data.frame. |
by |
Character vector of column names to group by.
Default: |
method |
Aggregation method: |
A data.frame with grouping columns plus score (0–1) and
n_evidence (count of rows).
ctx <- suppressMessages(r4sub_run_context("STUDY1", "DEV"))
ev <- suppressMessages(as_evidence(
data.frame(
asset_type = rep("validation", 3), asset_id = rep("ADSL", 3),
source_name = rep("pinnacle21", 3),
indicator_id = c("SD0001", "SD0001", "SD0002"),
indicator_name = c("SD0001", "SD0001", "SD0002"),
indicator_domain = rep("quality", 3),
severity = c("high", "medium", "low"),
result = c("fail", "warn", "pass"),
stringsAsFactors = FALSE
),
ctx = ctx
))
aggregate_indicator_score(ev, by = "indicator_id", method = "weighted")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.