Calculate cumulative mass

pb210_cumulative_mass(masses, position = 0.5)

Arguments

masses

A vector of sequential masses

position

0 for the cumulative mass at the top of the section and 1 for the cumulative mass at the bottom of the section (0.5 for the middle, which is the default).

Value

A vector of cumulative masses

Examples

# top of slice pb210_cumulative_mass(c(0.1, 0.1, 0.1, 0.1), position = 0)
#> [1] 0.0 0.1 0.2 0.3
# middle of slice pb210_cumulative_mass(c(0.1, 0.1, 0.1, 0.1), position = 0.5)
#> [1] 0.05 0.15 0.25 0.35
# bottom of slice pb210_cumulative_mass(c(0.1, 0.1, 0.1, 0.1), position = 1)
#> [1] 0.1 0.2 0.3 0.4