Learn R Programming

BigDataStatMeth (version 2.0.3)

as.data.frame.HDF5Matrix: 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 HDF5Matrix
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  force = FALSE,
  max_size_mb = NULL,
  ...
)

Value

data.frame with data from HDF5 file

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.

See Also

as.matrix.HDF5Matrix

Examples

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

Run the code above in your browser using DataLab