Skip to content
Prev 395324 / 398502 Next

Create new data frame with conditional sums

This seems to work. A couple of fine points, including handling duplicated Pct values right, which is easier if you do the reversed cumsum.
$x
 [1] 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14
[16] 0.15

$y
 [1] 43800 43800 39300 39300 31000 26750 22750 17800 12700 12700  8000  8000
[13]  8000  3900  3900  3900