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.

target
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 = "")
  1. target ← 80

    1target <- 802metrics <- c(82, 75, 91)
    values this step80target
  2. metrics ← 82, 75, 91

    1target <- 802metrics <- c(82, 75, 91)3passed <- metrics >= target
    values this step82, 75, 91metrics
  3. passed ← TRUE, FALSE, TRUE

    2metrics <- c(82, 75, 91)3passed <- metrics >= target4pass_count <- sum(passed)
    values this stepTRUE, FALSE, TRUEpassed82, 75, 91metrics80target
  4. pass_count ← 2

    3passed <- metrics >= target4pass_count <- sum(passed)5total <- length(metrics)
    values this step2pass_countTRUE, FALSE, TRUEpassed
  5. total ← 3

    4pass_count <- sum(passed)5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")
    values this step3total82, 75, 91metrics
  6. label ← 2/3

    5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")
    values this step2/3label2pass_count3total
  7. cat(label, " ", sep = "")

    6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")
    output2/3
    values this step2/3label
  1. target ← 70

    1target <- 702metrics <- c(82, 75, 91)
    values this step70target
  2. metrics ← 82, 75, 91

    1target <- 702metrics <- c(82, 75, 91)3passed <- metrics >= target
    values this step82, 75, 91metrics
  3. passed ← TRUE, TRUE, TRUE

    2metrics <- c(82, 75, 91)3passed <- metrics >= target4pass_count <- sum(passed)
    values this stepTRUE, TRUE, TRUEpassed82, 75, 91metrics70target
  4. pass_count ← 3

    3passed <- metrics >= target4pass_count <- sum(passed)5total <- length(metrics)
    values this step3pass_countTRUE, TRUE, TRUEpassed
  5. total ← 3

    4pass_count <- sum(passed)5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")
    values this step3total82, 75, 91metrics
  6. label ← 3/3

    5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")
    values this step3/3label3pass_count3total
  7. cat(label, " ", sep = "")

    6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")
    output3/3
    values this step3/3label
  1. target ← 90

    1target <- 902metrics <- c(82, 75, 91)
    values this step90target
  2. metrics ← 82, 75, 91

    1target <- 902metrics <- c(82, 75, 91)3passed <- metrics >= target
    values this step82, 75, 91metrics
  3. passed ← FALSE, FALSE, TRUE

    2metrics <- c(82, 75, 91)3passed <- metrics >= target4pass_count <- sum(passed)
    values this stepFALSE, FALSE, TRUEpassed82, 75, 91metrics90target
  4. pass_count ← 1

    3passed <- metrics >= target4pass_count <- sum(passed)5total <- length(metrics)
    values this step1pass_countFALSE, FALSE, TRUEpassed
  5. total ← 3

    4pass_count <- sum(passed)5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")
    values this step3total82, 75, 91metrics
  6. label ← 1/3

    5total <- length(metrics)6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")
    values this step1/3label1pass_count3total
  7. cat(label, " ", sep = "")

    6label <- paste(pass_count, total, sep = "/")7cat(label, "\n", sep = "")
    output1/3
    values 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.