In your example, if q0 = t, q1 = w, q2 = θ, q3 = Φ (where superscripts are indices), then the matrix of coefficients will be as follows, with superscript 2 denoting an exponent:
[tex]\begin{pmatrix}<br />
1 & 0 & 0 & 0\\ <br />
0 & R(t)^2 & 0 & 0\\ <br />
0 & 0 & (R(t) \cdot s)^2 & 0\\ <br />
0 & 0 & 0 & (R(t)\cdot s \cdot \sin(\theta))^2<br />
\end{pmatrix}[/tex]
= diag(1,0,0,0) - R(t)2[diag(0,1,0,0) + s2(diag(0,0,1,0)+diag(0,0,0,sin(θ)2)].
Here diag(a,b,c,d) denotes a diagonal 4x4 matrix with diagonal entries as indicated, from top left to bottom right.
In general, given an expression of the form
[tex]ds^2 = ...,[/tex]
where the values of the indices are not equal, the scalar coefficients in each term of the form
[tex]A \, dx^\mu dx^\nu \enspace (\text{no summation} )[/tex]
(EDIT: Ignore the words "no summation" - a relic of previous version which I forgot to remove before posting. Sorry.) correspond to matrix entries
[tex]g_{\mu\nu} = \frac{1}{2} A.[/tex]
And where the values of the indices are equal, the scalar coefficients in each term of the form
[tex]B \, (dx^\mu)^2[/tex]
correspond to matrix entries
[tex]g_{\mu\mu} = B.[/tex]