float (version 0.3-2)

diag: diag

Description

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

Usage

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

Value

A float vector or matrix, depending on the input.

Arguments

x

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

nrow, ncol

As in base R's diag().

Examples

Run this code
library(float)

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

Run the code above in your browser using DataLab