Last data update: 2014.03.03

R: Identity Matrix
eyeR 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 of class c("matrix", "mat").

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

Results