LTmat: Construct a symmetric matrix from its lower triangle.

View source: R/linpk.R

LTmatR Documentation

Construct a symmetric matrix from its lower triangle.

Description

Construct a symmetric matrix from its lower triangle.

Usage

LTmat(
  LT,
  ...,
  .names = attr(LT, ".names"),
  .colnames = .names,
  .rownames = .names
)

Arguments

LT

A numeric (or number-like) vector giving the elements of the lower triangle of the matrix by row (see examples).

...

Additional numeric (or number-like) vectors, appended to LT.

.names, .colnames, .rownames

Optionally, specify the row and column names of the resulting diagonal matrix. The names can also be specified as the LHS of a 2-sided formula (see Examples).

Value

A symmetric matrix.

Examples

LTmat(1:6)
LTmat(1, 3, 5, .names=c("a", "b"))
LTmat(c(a, b) ~ c(1, 3, 5))  # Names can also be specified as LHS of a 2-sided formula
LTmat(1+2i, 3+4i, 5+6i)

benjaminrich/linpk documentation built on April 18, 2024, 2:13 a.m.