rename_dim: Rename elements of a given dimension within an array

Description Usage Arguments Value Examples

View source: R/rename_dim.R

Description

A convenience function for working with matrices or arrays.

Usage

1
rename_dim(m, new_names, DIM = 2)

Arguments

m

matrix or array

new_names

character

DIM

numeric index or name of dimension (if dimensions are named) whose elements will be renamed

Value

m but with new names

Examples

1
2
m <- array(1:8, dim = c(3, 3, 2))
rename_dim(m, c("newname1", "newname2"), 3)

mcfreund/mfutils documentation built on Feb. 6, 2022, 4:57 a.m.