For each group, the sum of the "pcnt" value for each condition must not exceed 100 iterates reducing the percents equally of the other conditions.

reduce_condition_pcnts(conditions, current_conditions)

Arguments

conditions

the conditions (from params$groups[[.x]]$conditions)

current_conditions

the names of conditions to reduce by, initially all except the condition that has been changed

Value

the altered conditions

Details

If at any point the amount that we need to reduce (equally) by exceeds the smallest value, then we reduce all by the smallest group, then remove the smallest group and iterate.