powered by
TRUE
lower.tri(x, diag = FALSE) upper.tri(x, diag = FALSE)
diag
matrix
(m2 <- matrix(1:20, 4, 5)) lower.tri(m2) m2[lower.tri(m2)] <- NA m2
Run the code above in your browser using DataLab