triang: Upper triangular matrix from a vector

View source: R/utils.R

triangR Documentation

Upper triangular matrix from a vector

Description

Creates an upper triangular square matrix from a vector.

Usage

triang( v, n )

Arguments

v

vector

n

desired dimension of the returned square matrix

Note

If the vector has less elements than the upper triangular matrix, the last elements are set to zero.

Author(s)

Arne Henningsen

See Also

veclipos.

Examples

   v <- c( 1:5 )
   triang( v, 3 )

miscTools documentation built on May 3, 2023, 5:11 p.m.

Related to triang in miscTools...