diago: Diagonal matrix with offset

View source: R/utils.R

diagoR Documentation

Diagonal matrix with offset

Description

Diagonal matrix with offset

Usage

diago(x = 1, nrow = NA, ncol = NA, names = TRUE, offset = 1L)

Arguments

x

a matrix, vector or 1D array, or missing.

nrow, ncol

optional dimensions for the result when x is not a matrix.

names

(when x is a matrix) logical indicating if the resulting vector, the diagonal of x, should inherit names from dimnames(x) if available.

offset

an integer value to offset the diagonal by. Default is 1

Value

a square matrix


dmi3kno/qpd documentation built on Sept. 29, 2024, 6:39 p.m.