="#000100" size="3"># n[i, j] &lt;- sum(X[i, j, ])<br>
</font><font face="Arial" color="#000100" size="1">&nbsp;&nbsp;&nbsp;
</font><font face="Arial" color="#000100" size="3"># for (k in 1 : K) { # loop around foods<br>
</font><font face="Arial" color="#000100" size="1">&nbsp;&nbsp;&nbsp;
</font><font face="Arial" color="#000100" size="3"># p[i, j, k] &lt;- phi[i, j, k] / sum(phi[i, j, ])<br>
</font><font face="Arial" color="#000100" size="1">&nbsp;&nbsp;&nbsp;
</font><font face="Arial" color="#000100" siz