rray_set_names: Set names for every axis of an array

View source: R/names.R

rray_set_namesR Documentation

Set names for every axis of an array

Description

rray_set_names() sets the names for every axis of an array at once.

Usage

rray_set_names(x, names)

Arguments

x

An array.

names

A list with length equal to the dimensionality of x, where each element is either a character vector of names for that axis or NULL. Can also be NULL to remove all names from x. The names of names become the titles of x.

Value

x with new names.

Examples

x <- array(1:6, c(2, 3))

rray_set_names(x, list(c("r1", "r2"), c("c1", "c2", "c3")))

# `NULL` clears all names
y <- rray_set_names(x, list(c("r1", "r2"), NULL))
rray_set_names(y, NULL)

rray documentation built on Nov. 17, 2026, 5:07 p.m.