Learn R Programming

BigDataStatMeth (version 2.0.3)

dimnames.HDF5Matrix: 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 HDF5Matrix
dimnames(x)

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

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

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

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

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.

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.

Examples

Run this code
# \donttest{
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)

# }

Run the code above in your browser using DataLab