length.HDF5Matrix: Length of an HDF5Matrix

View source: R/S3_core.R

length.HDF5MatrixR Documentation

Length of an HDF5Matrix

Description

Returns the total number of elements in an HDF5Matrix object, defined as prod(dim(x)) — consistent with the behaviour of base::length() for ordinary R matrices.

Usage

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

Arguments

x

An HDF5Matrix object.

Value

A single integer: nrow(x) * ncol(x).

Examples


tmp <- tempfile(fileext = ".h5")
X <- hdf5_create_matrix(tmp, "data/m", data = matrix(1:100, 10, 10))
length(X)   # 100
close(X); unlink(tmp)



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