Skip to contents

Returns integer names if present, otherwise character dimnames. Use instead of rownames() for guaranteed dispatch.

Usage

row_names(x)

row_names(x) <- value

# Default S3 method
row_names(x) <- value

# S3 method for class 'matrix_int_names'
row_names(x) <- value

Arguments

x

A matrix_int_names object

value

Integer or character vector of row names, or NULL

Value

Integer or character vector of row names, or NULL

The modified matrix_int_names object

Examples

my_mat <- matrix_int_names(matrix(1:6, nrow = 2),
  row_names = c(10L, 20L),
  col_names = c(100L, 200L, 300L)
)
row_names(my_mat)
#> [1] 10 20
row_names(my_mat) <- c(1L, 2L)
row_names(my_mat)
#> [1] 1 2