QR factorisation using the Gram-Schmidt process
Let $\v a_1, \ldots, \v a_n\in \R^m$ be the columns of $A$. By performing the Gram-Schmidt process on $\v a_1, \ldots, \v a_n$, we find an orthonormal set $\v q_1, \ldots, \v q_k \in \R^m$ ($k\leq n$) and coefficients $r_{ij}\in \R$ such that $$ \begin{align*} \v a_i = \sum_{j=1}^{i} r_{ji} \v q_j. \end{align*} $$ Then $$ \begin{align*} A = \underbrace{\pmat{\v q_1 & \ldots & \v q_k}}_{Q} \underbrace{\pmat{r_{11} & r_{12} & \ldots & r_{1k} & \ldots & r_{1n} \\ & r_{22} & \ldots & r_{2k} & \ldots & r_{2n} \\ &&\ddots & \vdots & & \vdots\\ &&&r_{kk} & \ldots & r_{kn}}}_{R}. \end{align*} $$
Example (QR factorisation using the Gram-Schmidt process)
However Gram-Schmidt is very numerically unstable.