Weighted rowSums of a matrix
<p>I have a matrix like this:</p>

<p><a href="https://i.stack.imgur.com/1ckfJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ckfJ.jpg" alt=""></a></p>

<p>I would like to sum every value of a single row but weighted.</p>

<p>Example: Given a specific row, the sum would be:</p>

<pre><code>S = x1 * loan + x2 * mortdue + x3 * value + ...
</code></pre>

<p><code>x1, x2, x3, ...</code> are predefined values.</p>

<p>I tried <code>rowSums()</code> and things like that but I have not been able to figure out how to do it properly.</p>