You seem to be thinking of the tensors in terms of matrices, when sometimes (especially when doing computation) it can be more useful to just think about them as collections of numbers, without thinking too much about how to arrange them in rows or columns. I'll use index notation with explicit sums so that you can see better how the computation goes.
You earlier found the Ricci tensor by doing the computation
$$R_{\mu\nu} = R_{\mu\sigma\nu}{}^{\sigma} = \sum_{\sigma} R_{\mu\sigma\nu}{}^{\sigma}.$$
Some authors put the upper index in other positions, but that's the general idea. The Ricci scalar is given by
$$R = R_{\mu\nu}g^{\mu\nu} = \sum_{\mu,\nu} R_{\mu\nu}g^{\mu\nu}.$$
To compute it, all you need to do is to evaluate the double sum. Since addition is commutative and associative, you can do it in whichever order you prefer (the result is the same regardless of computing the sum over $\mu$ first of the sum over $\nu$ first).
Thinking in terms of matrices makes these operations somewhat more complicated, since you have to keep track of what is a row and what is a column everytime. The beauty of working with indices is that you don't need to go through all that trouble, and the notation pretty much solves all those issues for you. While it is a bit strange at first, it is quite useful on the long run.