i

R Programming Complete Tutorial

R Matrix Modification

Like vector and list, we can directly assign a value in the specific position of the Matrix. If we assign 10 the position mat1 [2, 2], it will update the new value replacing the previous value.

We can remove all the matrix elements, just assigning NULL to the Matrix.