<code>collapse_to_matrices</code> relies
on grouping to indicate which rows of the tidy data frame belong to
which matrices. The usual approach is to <code>tidyr::group_by</code>
the <code>matnames</code> column and any other columns to be preserved
in the output, in this case <code>Country</code> and
<code>Year</code>.</p>
<div class="sourceCode" id="cb3"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="va">EnergyMats_2000</span> <span class="op">&lt;-</span> <span class="va