object_size: Get memory size of HDF5Matrix without loading

View source: R/S3_conversion.R

object_sizeR Documentation

Get memory size of HDF5Matrix without loading

Description

Estimates how much memory the dataset would occupy if loaded into RAM.

Usage

object_size(x, unit = c("MB", "bytes", "KB", "GB"))

Arguments

x

An HDF5Matrix object

unit

Character. Unit for size: "bytes", "KB", "MB", "GB". Default "MB".

Value

Numeric value with estimated memory size

Examples


    fn <- tempfile(fileext = ".h5")
    X <- hdf5_create_matrix(fn, "data/X", nrow = 100, ncol = 50)
    object_size(X)
    object_size(X, unit = "KB")
    hdf5_close_all()
    unlink(fn)



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