I have created a blocked matrix as shown below:
However, I'm not happy about the following three things:
1) How can I change those two demarcation lines (one with vertical bars and the other with dashed line) to two whole lines?
2) "G1" at the top is not well centered relative to the left portion of the matrix. "G1" and "G2" on the left side are not vertically centered relative to the upper and lower portion of the matrix, respectively.
3) The "R=" part on the left is not vertically centered.
Here is the code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{blkarray}
\begin{document}
\begin{minipage}{\textwidth}{
$\boldsymbol{R} =
\begin{blockarray}{ccccccccccc}
& & & & G1 & & | & & G2 & \\
& & S_1 & S_2 & ... & S_{n_1} & | & S_{n_1+1} & S_{n_1+2} & ... & S_n \\
\begin{block}{cc(ccccccccc)}
&S_1 & {1} & r_{12} & ... & r_{1n_1} &| & r_{1(n_1+1)} & r_{1(n_1+2)} & ... & r_{1n} \\
G1&S_2 & r_{12} & 1 &...& r_{2n_1} & | & r_{2(n_1+1)} & r_{2(n_1+2)} & ... & r_{2n} \\
&\vdots & \vdots & \vdots &\vdots & \vdots & | &\vdots & \vdots & \vdots &\vdots \\
&S_{n_1} & r_{1n_1} & r_{2n_1} & ... & 1 & | & r_{n_1(n_1+1)} & r_{n_2(n_1+2)}& ... & r_{n_1n} \\
-&-& - & - & - & - & - & - & - & - & -\\
&S_{n1+1} & r_{1(n_1+1)} & r_{2(n_1+1)} & ... & r_{n_1(n_1+1)} & | & r_{(n_1+1)(n_1+1)} & r_{(n_1+1)(n_1+2)} & ... & r_{(n_1+1) n} \\
&S_{n1+2} & r_{1(n_1+2)} & r_{2(n+1+2)} & ... & r_{(n_1+2)(n_1+1)} & | & r_{(n_1+1)(n_1+2)} & r_{(n_1+2)(n_1+2)} & ... & r_{(n_1+2) n} \\
G2 &\vdots & \vdots & \vdots &\vdots & \vdots & | & \vdots &\vdots & \vdots & \vdots \\
&S_n & r_{1n} & r_{2n} &...& r_{n_1 n} & | & r_{(n_1+1)n} & r_{(n_1+2)n} & ... & r_{nn} \\
\end{block}
\end{blockarray}$
}
\end{minipage}
\end{document}

