powered by
nrow
ncol
eye(nrow = 1, ncol = nrow)
diag
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
Run the code above in your browser using DataLab