replaceDown: Replace matrix values triangular lower part and by band for...

View source: R/global.R

replaceDownR Documentation

Replace matrix values triangular lower part and by band for the upper part.

Description

F matrices utility function.

Usage

replaceDown(a, b, k)

Arguments

a

The matrix to be replaced

b

The matrix with the replacement values

k

The extend of the replacement: 0 (lower part and diagonal only), 1 (lower part and first extra diagonal), in general an entry is replaced if -(row(a) - col(a)) <= k

Value

A matrix (same size as a)

Author(s)

Bertrand Frederic, Myriam Maumy-Bertrand.

Examples


a=matrix(1:9,3,3)
b=matrix(1,3,3)
replaceDown(a,b,0)
replaceDown(a,b,1)
replaceDown(a,b,2)


fbertran/Patterns documentation built on Dec. 8, 2022, 8:48 p.m.