Learn R Programming

DGM (version 1.7.4)

rmdiag: Removes diagonal of NA's from matrix.

Description

Removes diagonal of NA's from matrix.

Usage

rmdiag(M)

Arguments

M

Matrix

Value

matrix with diagonal of 0's.

Examples

Run this code
# NOT RUN {
M=array(rnorm(3*3), dim=c(3,3))
M[as.logical(diag(3))] = NA
M=rmna(M)
# }

Run the code above in your browser using DataLab