Learn R Programming

BigDataStatMeth (version 2.0.3)

object_size: 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"))

Value

Numeric value with estimated memory size

Arguments

x

An HDF5Matrix object

unit

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

Examples

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

Run the code above in your browser using DataLab