Piecewise-linear scoring curve anchored on a green (full marks, 100) and amber
(half marks, 50) threshold, extrapolated linearly to a hard 0 floor an equal
step beyond amber, and clamped to [0, 100]. Returns NA when the value or
either threshold is NA, so undefined dimensions drop out of the composite
rather than scoring as 0.
Usage
score_curve(x, green, amber, direction = c("higher_better", "lower_better"))