dimnames: Set matrix row or column names

dimnamesR Documentation

Set matrix row or column names

Description

Set matrix row or column names without copying, especially useful for (very) large matrices.

Usage

setColnames(matrix, colnames)
setRownames(matrix, rownames)
setDimnames(matrix, nameslist)

Arguments

matrix

An R matrix

colnames

Character vector of column names

rownames

Character vector of row names

nameslist

A two-component list containing rownames and colnames

Author(s)

Adrian Dusa

Examples


mat <- matrix(1:9, nrow = 3)
setDimnames(mat, list(LETTERS[1:3], letters[1:3]))

admisc documentation built on Sept. 12, 2024, 6:27 a.m.

Related to dimnames in admisc...