powered by
Returns a matrix of logicals the same size of a given matrix with entries TRUE in the lower or upper triangle.
TRUE
lower.tri(x, diag = FALSE) upper.tri(x, diag = FALSE)
a matrix or other R object with length(dim(x)) == 2. For back compatibility reasons, when the above is not fulfilled, as.matrix(x) is called first.
length(dim(x)) == 2
as.matrix(x)
logical. Should the diagonal be included?
diag, matrix; further row and col on which lower.tri() and upper.tri() are built.
diag
matrix
row
col
lower.tri()
upper.tri()
# NOT RUN { (m2 <- matrix(1:20, 4, 5)) lower.tri(m2) m2[lower.tri(m2)] <- NA m2 # }
Run the code above in your browser using DataLab