matrix_helpers: Create matrices from vector input

matrix_helpersR Documentation

Create matrices from vector input

Description

These functions are simple utilities for creating diagonal, block or correlation matrices.

Usage

bmat(..., correlation = FALSE, digits = -1)

cmat(..., digits = -1)

dmat(...)

Arguments

...

matrix data.

correlation

logical; if TRUE, off-diagonal elements are assumed to be correlations and converted to covariances.

digits

if greater than zero, matrix is passed to signif() (along with digits) prior to returning.

Details

bmat() makes a block matrix. cmat() makes a correlation matrix. dmat() makes a diagonal matrix.

Value

A matrix.

See Also

as_bmat(), as_dmat()

Examples


dmat(1,2,3)/10

bmat(0.5,0.01,0.2)

cmat(0.5, 0.87,0.2)


mrgsolve documentation built on Oct. 18, 2024, 5:12 p.m.