triu: Extract Upper Triangular Matrix

Description Usage Arguments Examples

Description

Extract the upper triangular part of a matrix.

Usage

1
triu(x, k = 0, diag = TRUE)

Arguments

x

A matrix.

k

Diagonal below which to zero elements. k = 0 (the default) is the main diagonal, k < 0 is below it and k > 0 is above.

diag

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

Examples

1
2
triu(ones(5, 5))
triu(ones(5, 5), diag = FALSE)

bgreenwell/ramify documentation built on May 12, 2019, 8:20 p.m.