Reduced Row-Echelon Form of a Matrix
R, 232 bytes



function(M){p=1;R=nrow(M);C=ncol(M);for(r in 1:R){if(C&lt;=p)break;i=r;while(M[i,p]==0){i=i+1;if(R==i){i=r;p=p+1;if(C==p)return(M)}};t=M[i,];M[i,]=M[r,];M[r,]=t;M[r,]=M[r,]/M[r,p];for(i in 1:R)if(i!=r)M[i,]=M[i,]-M[r,]*M[i,p];p=p+1};M}


This is just an implementation of the usual Gaussian elimination algorithm.

Ungolfed:

rref &lt;- function(M) {
    p &lt;- 1
    R &lt;- nrow(M)
    C &lt;- ncol(M)
    for (r in 1:R) {
        if (C &lt;= p)
            break
        i &lt;- r
        while (M[i, p] == 0) {
            i &lt;- i + 1
            if (R == i) {
                i &lt;- r
                p &lt;- p + 1
                if (C == p)
                    return(M)
            }
        }
        t &lt;- M[i, ]
        M[i, ] &lt;- M[r, ]
        M[r, ] &lt;- t
        M[r, ] &lt;- M[r, ] / M[r, p]
        for (i in 1:R)
            if (i != r)
                M[i, ] &lt;- M[i, ] - M[r, ] * M[i, p]
        p &lt;- p + 1
    }
    M
}