object_size

object_size

HDF5MATRIX_CORE

1 Description

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

2 Usage

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

3 Arguments

Parameter Description
x An object
unit Character. Unit for size: “bytes”, “KB”, “MB”, “GB”. Default “MB”.

4 Value

Numeric value with estimated memory size

5 Examples

\donttest{
    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)
}