R/diag.ind.R

`diag.ind` <-
function (x, n=1, diag = TRUE) {
  x <- as.matrix(x)
  if (diag) {
    !(row(x) > col(x)) + (row(x) <= col(x)-n)
  } else { !(row(x) >= col(x)) + (row(x) <= col(x)-n) }
}

Try the bio3d package in your browser

Any scripts or data that you put into this service are public.

bio3d documentation built on Oct. 27, 2022, 1:06 a.m.