rray_axis_names()returns the names for a singleaxisof an array, orNULLif that axis has no names.rray_row_names()andrray_column_names()are shortcuts forrray_axis_names(x, 1)andrray_axis_names(x, 2).
Arguments
- x
An array.
- axis
The axis to get names for, given by position or by title.
Examples
x <- array(1:6, c(2, 3), dimnames = list(c("r1", "r2"), c("c1", "c2", "c3")))
rray_axis_names(x, 1)
#> [1] "r1" "r2"
rray_axis_names(x, 2)
#> [1] "c1" "c2" "c3"
# By title
y <- rray_set_titles(x, c("row", "col"))
rray_axis_names(y, "col")
#> [1] "c1" "c2" "c3"
rray_row_names(x)
#> [1] "r1" "r2"
rray_column_names(x)
#> [1] "c1" "c2" "c3"
