Matrix diagonals, diagonal matrices and identity matrices. Equivalent to R's diag(). It has three meanings: the
diagonal of a matrix (as a vector); the diagonal matrix of a vector of length 2 or more (its values recycled along the diagonal of an nrow x ncol matrix when given); and for a single
number n, the n x n identity matrix (with nrow/ncol, a matrix with that number on the diagonal).
Matrix diagonals, diagonal matrices and identity matrices. Equivalent to R's
diag(). It has three meanings: the diagonal of a matrix (as a vector); the diagonal matrix of a vector of length 2 or more (its values recycled along the diagonal of annrowxncolmatrix when given); and for a single number n, the n x n identity matrix (withnrow/ncol, a matrix with that number on the diagonal).