eye {ramify}R Documentation

Identity Matrix

Description

Creates an nrow-by-ncol identity matrix.

Usage

eye(nrow = 1, ncol = nrow)

Arguments

nrow

The desired number of rows.

ncol

The desired number of columns.

Value

A nrow-by-ncol identity matrix.

See Also

diag.

Examples

eye(4) # 4-by-4 identity matrix
eye(4, 4) # 4-by-4 identity matrix
eye(3, 5) # 3-by-5 identity matrix
eye(5, 3) # 5-by-3 identity matrix

[Package ramify version 0.4.0 Index]