dimnames.HDF5Matrix: Get dimension names of an HDF5Matrix

View source: R/S3_dimnames.R

dimnames.HDF5MatrixR Documentation

Get dimension names of an HDF5Matrix

Description

Returns the row and column names stored alongside the HDF5 dataset, following the BigDataStatMeth convention. Returns NULL when no names have been stored for a given dimension.

Usage

## S3 method for class 'HDF5Matrix'
dimnames(x)

rownames.HDF5Matrix(x, do.NULL = TRUE, prefix = "row")

colnames.HDF5Matrix(x, do.NULL = TRUE, prefix = "col")

## S3 replacement method for class 'HDF5Matrix'
rownames(x) <- value

## S3 replacement method for class 'HDF5Matrix'
colnames(x) <- value

Arguments

x

An HDF5Matrix object

do.NULL

Logical. Ignored; present for base compatibility.

prefix

Character. Ignored; present for base compatibility.

value

Character vector of column names, or NULL to remove.

Value

A list of length 2 with elements [[1]] (rownames) and [[2]] (colnames), or NULL for dimensions without names. Returns NULL when neither dimension has names.

Examples


tmp <- tempfile(fileext = ".h5")

m <- matrix(1:6, 2, 3,
            dimnames = list(c("r1","r2"), c("c1","c2","c3")))

X <- hdf5_create_matrix(tmp, "data/mat", data = m)

dimnames(X)
rownames(X)
colnames(X)
rownames(X) <- c("row1", "row2")
rownames(X)
hdf5_close_all()
unlink(tmp)




BigDataStatMeth documentation built on May 15, 2026, 1:07 a.m.