g of columns</span></span></span>
<span class="r-in"><span><span class="va">scores</span> <span class="op">&lt;-</span> <span class="va">test</span><span class="op">$</span><span class="va">u</span> <span class="op"><a href="https://rdrr.io/r/base/matmult.html" class="external-link">%*%</a></span> <span class="fu"><a href="https://rdrr.io/r/base/diag.html" class="external-link">diag</a></span><span class="op">(</span><span class="va">test</span><span class="op">$</span><span class="va">d</span><span class="