Returns a matrix of logicals the same size of a given matrix with
entries TRUE in the lower or upper triangle.
lower.tri(x, diag = FALSE)
upper.tri(x, diag = FALSE)
logical. Should the diagonal be included?
(m2 <- matrix(1:20, 4, 5))
m2[lower.tri(m2)] <- NA
Questions? Problems? Suggestions? Tweet to @rdrrHQian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.