This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/lower.tri.html
lower.tri {base}R Documentation

Lower and Upper Triangular Part of a Matrix

Usage

lower.tri(x, diag=FALSE)
upper.tri(x, diag=FALSE)

Arguments

x

a matrix.

diag

logical. Should the diagonal be included?

Value

Returns a logical matrix of the same dimension as x which is TRUE for the relevant triangular part of x.

See Also

diag, matrix.

Examples

m2 <- ma <- matrix(1:20, 4, 5)
m2[lower.tri(m2)] <- NA
m2
all(lower.tri(ma) == !upper.tri(ma, diag=TRUE))

[Package base version 0.60 ]