tri: Lower/Upper Triangular Matrix

Description Usage Arguments Examples

Description

Construct a matrix with ones at and below the given diagonal and zeros elsewhere.

Usage

1
tri(nrow, ncol = nrow, k = 0, diag = TRUE)

Arguments

nrow

The desired number of rows.

ncol

The desired number of columns.

k

The sub-diagonal at and below which the matrix is filled. k = 0 is the main diagonal, while k < 0 is below it, and k > 0 is above. The default is 0.

diag

Logical indicating whether to include the diagonal. Default is TRUE.

Examples

1
2
3
tri(5, 5)
tri(5, 5, 2)
tri(5, 5, -1)

ramify documentation built on May 2, 2019, 5:58 a.m.