deletediagonals | R Documentation |
Replace a diagonal of elements of a matrix with NA
deletediagonals(x, diagonals = 1)
x |
The matrix |
diagonals |
The diagonal to be replaced, i.e. the first, second and so on when looking at the fat version of the matrix (transposed or not) counting from the bottom. Can be a vector to delete more than one diagonal. |
Used for creating artifical missing values in matrices without causing any full row or column to be completely missing
The original matrix with some values missing
Henning Redestig
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.