as.data.frame.HDF5Matrix: Convert HDF5Matrix to data.frame

View source: R/S3_conversion.R

as.data.frame.HDF5MatrixR Documentation

Convert HDF5Matrix to data.frame

Description

Reads entire HDF5 dataset into memory as a data.frame. WARNING: This loads all data into RAM.

Usage

## S3 method for class 'HDF5Matrix'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  force = FALSE,
  max_size_mb = NULL,
  ...
)

Arguments

x

An HDF5Matrix object

row.names

Logical or character vector. Row names to use.

optional

Logical. Passed to as.data.frame.

force

Logical. If TRUE, skip size warnings.

max_size_mb

Numeric. Maximum size in MB to convert without warning.

...

Additional arguments passed to as.data.frame

Details

First converts to matrix using as.matrix.HDF5Matrix (with same size checks), then to data.frame. All memory warnings apply.

Value

data.frame with data from HDF5 file

See Also

as.matrix.HDF5Matrix

Examples


    fn <- tempfile(fileext = ".h5")
    X <- hdf5_create_matrix(fn, "data/X", data = matrix(rnorm(500), 100, 5))
    df <- as.data.frame(X)
    hdf5_close_all()
    unlink(fn)



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