utils_mat: Utilities for handling with matrices

Description Usage Arguments Details Value Author(s) Examples

Description

[Stable]

These functions help users to make upper, lower, or symmetric matrices easily.

Usage

1
2
3
4
5
6
7
8
9
make_upper_tri(x, diag = NA)

make_lower_tri(x, diag = NA)

make_lower_upper(lower, upper, diag = NA)

make_sym(x, make = "upper", diag = NA)

tidy_sym(x, keep_diag = TRUE)

Arguments

x

A matrix to apply the function. It must be a symmetric (square) matrix in make_upper_tri() and make_lower_tri() or a triangular matrix in make_sym(). tidy_sym() accepts both symmetrical or triangular matrices.

diag

What show in the diagonal of the matrix. Default to NA.

lower

A square matrix to fill the lower diagonal of the new matrix.

upper

A square matrix to fill the upper diagonal of the new matrix.

make

The triangular to built. Default is "upper". In this case, a symmetric matrix will be built based on the values of a lower triangular matrix.

keep_diag

Keep diagonal values in the tidy data frame? Defaults to TRUE.

Details

Value

An upper, lower, or symmetric matrix, or a tidy data frame.

Author(s)

Tiago Olivoto tiagoolivoto@gmail.com

Examples

1
2
3
4
5
6
7
8

metan documentation built on Nov. 10, 2021, 9:11 a.m.