/span><span class="op">(</span><span class="va">s</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {5, 4, 3, 1, 2}</span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/base/cumsum.html" class="external-link">cumsum</a></span><span class="op">(</span><span class="va">s</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> {5, 9, 12, 13, 15}</span>
<span class="r-in"><span><span class="fu"