Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

triang

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

Examples

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

miscTools

Miscellaneous Tools and Utilities

v0.6-26
GPL (>= 2)
Authors
Arne Henningsen, Ott Toomet
Initial release
2019-12-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.