Is this the sort of thing you are looking for? I am guessing that the product of the Observed and the Proportion gives you a predicted number of counts and you want to combine all cases where the predicted number of counts is less than 5. The total number of predicted counts is preserved.
Observed=c(181,132,96,20,168,86,105,313,206)
Proportion=c(0.5005,0.3389,0.0667,0.0031,0.0338,0.0225,0.0067,0.0116,0.0162)
PredCounts <- Observed * Proportion
PredCounts
#> [1] 90.5905 44.7348 6.4032 0.0620 5.6784 1.9350 0.7035 3.6308 3.3372
sum(PredCounts)
#> [1] 157.0754
ObsMod <- c(Observed[1], Observed[2], Observed[3],
sum(Observed[4], Observed[6], Observed[7], Observed[8], Observed[9]),
Observed[5])
PropMod <- c(Proportion[1], Proportion[2], Proportion[3],
sum(Proportion[4], Proportion[6], Proportion[7], Proportion[8], Proportion[9]),
Proportion[5])
PredCountsMod <- ObsMod * PropMod
PredCountsMod
#> [1] 90.5905 44.7348 6.4032 43.8730 5.6784
sum(PredCounts)
#> [1] 157.0754
Created on 2020-11-21 by the reprex package (v0.3.0)