Clips numerical under/overflow and renormalises so that \(\mathbf{1}^{\mathsf{T}}\boldsymbol{p}=1\) and \(\boldsymbol{p}\ge\mathbf{0}\). This is a repair / renormalisation step for estimated proportions, not a Euclidean projection onto the simplex and not a statistical-identifiability constraint.
See also
compositions::clo() for compositional closure.
Examples
repair_simplex(c(0.2, 0.3, 0.5 + 1e-12))
#> [1] 0.2 0.3 0.5