diag: diag

diagR Documentation

diag

Description

Methods for getting the diagonal of a float matrix, or constructing a float matrix given a float vector.

Usage

## S4 method for signature 'float32'
diag(x = 1, nrow, ncol)

Arguments

x

A float vector (create a diagonal matrix) or matrix (get its diagonal).

nrow, ncol

As in base R's diag().

Value

A float vector or matrix, depending on the input.

Examples

library(float)

s = flrunif(10, 3)
s
diag(s)
diag(diag(s))


float documentation built on May 29, 2024, 8:13 a.m.