Capstone Mini Projects
Scorecard Summary
Count Passing Metrics
A capstone scorecard turns several project metrics into a small pass-count summary.
Program
Play the script to change the target score and watch the summary change.
scorecard_summary.R
Replay: real traced execution (multi-file project)
target <- 80
metrics <- c(82, 75, 91)
passed <- metrics >= target
pass_count <- sum(passed)
total <- length(metrics)
label <- paste(pass_count, total, sep = "/")
cat(label, "\n", sep = "")
target <- 70
metrics <- c(82, 75, 91)
passed <- metrics >= target
pass_count <- sum(passed)
total <- length(metrics)
label <- paste(pass_count, total, sep = "/")
cat(label, "\n", sep = "")
target <- 90
metrics <- c(82, 75, 91)
passed <- metrics >= target
pass_count <- sum(passed)
total <- length(metrics)
label <- paste(pass_count, total, sep = "/")
cat(label, "\n", sep = "")
target ← 80
1target <- 802metrics <- c(82, 75, 91)values this step80targetmetrics ← 82, 75, 91
1target <- 802metrics <- c(82, 75, 91)3passed <- metrics >= targetvalues this step82, 75, 91metricspassed ← TRUE, FALSE, TRUE
2metrics <- c(82, 75, 91)3passed <- metrics >= target4pass_count <- sum(passed)values this stepTRUE, FALSE, TRUEpassed82, 75, 91metrics80targetpass_count ← 2
3passed <- metrics >= target4pass_count <- sum(passed)5total <- length(metrics)values this step2pass_countTRUE, FALSE, TRUEpassedtotal ← 3
4pass_count <- sum(passed)5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")values this step3total82, 75, 91metricslabel ← 2/3
5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")values this step2/3label2pass_count3totalcat(label, " ", sep = "")
6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")output2/3values this step2/3label
target ← 70
1target <- 702metrics <- c(82, 75, 91)values this step70targetmetrics ← 82, 75, 91
1target <- 702metrics <- c(82, 75, 91)3passed <- metrics >= targetvalues this step82, 75, 91metricspassed ← TRUE, TRUE, TRUE
2metrics <- c(82, 75, 91)3passed <- metrics >= target4pass_count <- sum(passed)values this stepTRUE, TRUE, TRUEpassed82, 75, 91metrics70targetpass_count ← 3
3passed <- metrics >= target4pass_count <- sum(passed)5total <- length(metrics)values this step3pass_countTRUE, TRUE, TRUEpassedtotal ← 3
4pass_count <- sum(passed)5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")values this step3total82, 75, 91metricslabel ← 3/3
5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")values this step3/3label3pass_count3totalcat(label, " ", sep = "")
6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")output3/3values this step3/3label
target ← 90
1target <- 902metrics <- c(82, 75, 91)values this step90targetmetrics ← 82, 75, 91
1target <- 902metrics <- c(82, 75, 91)3passed <- metrics >= targetvalues this step82, 75, 91metricspassed ← FALSE, FALSE, TRUE
2metrics <- c(82, 75, 91)3passed <- metrics >= target4pass_count <- sum(passed)values this stepFALSE, FALSE, TRUEpassed82, 75, 91metrics90targetpass_count ← 1
3passed <- metrics >= target4pass_count <- sum(passed)5total <- length(metrics)values this step1pass_countFALSE, FALSE, TRUEpassedtotal ← 3
4pass_count <- sum(passed)5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")values this step3total82, 75, 91metricslabel ← 1/3
5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")values this step1/3label1pass_count3totalcat(label, " ", sep = "")
6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")output1/3values this step1/3label
scorecard
A scorecard stores several project metrics in one vector.
threshold
Changing `target` changes which metrics count as passing.
summary
`sum(passed)` counts TRUE values in the logical vector.