yr.tidyverse.org/reference/group_split.html" class="external-link">group_split</a></span><span class="op">(</span><span class="op">)</span></code></pre></div>
<div class="section level3">
<h3 id="gains-losses-calculation-1">Gains &amp; Losses Calculation<a class="anchor" aria-label="anchor" href="#gains-losses-calculation-1"></a>
</h3>
<p>This time to calculate gains and losses for each investor’s portfolio we can simply <code>map</code> <code>portfolio_compute</code> on the list of transactions, specifyi