Learn R Programming

BBmisc (version 1.13)

setRowNames: Wrapper for rownames(x) = y, colnames(x) = y.

Description

Wrapper for rownames(x) = y, colnames(x) = y.

Usage

setRowNames(x, names)

setColNames(x, names)

Value

Changed object x.

Arguments

x

[matrix | data.frame]
Matrix or data.frame.

names

[character]
New names for rows / columns.

Examples

Run this code
setColNames(matrix(1:4, 2, 2), c("a", "b"))

Run the code above in your browser using DataLab